diff --git a/iptv b/iptv index 49c5357..3f20f15 100755 --- a/iptv +++ b/iptv @@ -12,10 +12,14 @@ player_pid_file="/tmp/iptvplayerpid" mkdir -p "$config_path" -if [ -z "$m3u" ] && [ ! -s "$channels_file" ]; then - echo "No M3U playlist has been configured. Run with: iptv http://domain/playlist.m3u" - exit 1 -fi +usage() { + cat < $channels_file } +if [ -z "$m3u" ] && [ ! -s "$channels_file" ]; then + usage + exit 1 +fi + +if [[ $1 == "-h" ]] || [[ $1 == "--help" ]]; then + usage + exit 0 +fi + if [ ! -z "$m3u" ]; then echo "$m3u" > $m3u_url_file save_channels