Break out saving channels into a function
This commit is contained in:
parent
bbed9f89f2
commit
c608750c3a
6
iptv
6
iptv
@ -16,7 +16,7 @@ if [ -z "$m3u" ] && [ ! -s "$channels_file" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -z "$m3u" ]; then
|
||||
save_channels() {
|
||||
printf "\nLoading channels... "
|
||||
curl -s $m3u | grep EXTINF: -A 2 > $tmp_playlist
|
||||
printf "Done!\n"
|
||||
@ -46,6 +46,10 @@ if [ ! -z "$m3u" ]; then
|
||||
printf "Done!\n"
|
||||
|
||||
printf "%s\n" "${channels[@]}" > $channels_file
|
||||
}
|
||||
|
||||
if [ ! -z "$m3u" ]; then
|
||||
save_channels
|
||||
|
||||
echo "Playlist saved. Now run iptv again without a M3U URL."
|
||||
exit
|
||||
|
Loading…
Reference in New Issue
Block a user