From 88120b1eb0266012f3c45ffc3c8218c8bdc972d5 Mon Sep 17 00:00:00 2001 From: Zhineng Li Date: Fri, 23 Jan 2026 15:34:32 +0800 Subject: quote variable references --- iptv.sh | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'iptv.sh') diff --git a/iptv.sh b/iptv.sh index 198a2b1..2e5b3f2 100755 --- a/iptv.sh +++ b/iptv.sh @@ -96,9 +96,9 @@ make_epg () { response=$(curl --silent $curl_args "$endpoint") step "Create the EPG XML file" - echo '' > $output_file - echo '' >> $output_file - echo "" >> $output_file + echo '' > "$output_file" + echo '' >> "$output_file" + echo "" >> "$output_file" while read -r item; do item_title=$(echo "$item" | jq -r '.itemTitle') @@ -113,24 +113,24 @@ make_epg () { channel_title=$(echo "$response" | jq -r '.channel.title') hwcode=$(echo "$response" | jq -r '.channel.params.hwcode') - echo " " >> $output_file - echo " " >> $output_file - echo " " >> $output_file - echo " " >> $output_file + echo " " >> "$output_file" + echo " " >> "$output_file" + echo " " >> "$output_file" + echo " " >> "$output_file" while read -r schedule; do schedule_title=$(echo "$schedule" | jq -r '.title') schedule_starttime=$(echo "$schedule" | jq -r '.starttime') schedule_endtime=$(echo "$schedule" | jq -r '.endtime') - echo " " >> $output_file - echo " <![CDATA[$schedule_title]]>" >> $output_file - echo " " >> $output_file + echo " " >> "$output_file" + echo " <![CDATA[$schedule_title]]>" >> "$output_file" + echo " " >> "$output_file" done < <(echo "$response" | jq -c '.schedules[]') fi done < <(echo "$response" | jq -c '.areaDatas[].items[]') - echo '' >> $output_file + echo '' >> "$output_file" step "EPG built sucessfully!" @@ -244,8 +244,8 @@ make_playlist () { http://$host/EPG/interEpg/channellist/batch) step "Decode channels from the HTTP response" - echo "#EXTM3U" > $output_file - echo "#EXT-X-VERSION:3" >> $output_file + echo '#EXTM3U' > "$output_file" + echo '#EXT-X-VERSION:3' >> "$output_file" echo "$response" | jq -c '.channellist[]' | while read -r channel; do channelcode=$(echo "$channel" | jq -r '.channelcode') @@ -261,8 +261,8 @@ make_playlist () { group=$(categorize_by_channel_name "$channelname") - echo "#EXTINF:-1 tvg-id=\"$channelcode\" tvg-name=\"$channelname\" tvg-logo=\"${logos[$channelcode]}\" group-name=\"$group\",$channelname" >> $output_file - echo "$udpxy_endpoint/udp/$host" >> $output_file + echo "#EXTINF:-1 tvg-id=\"$channelcode\" tvg-name=\"$channelname\" tvg-logo=\"${logos[$channelcode]}\" group-name=\"$group\",$channelname" >> "$output_file" + echo "$udpxy_endpoint/udp/$host" >> "$output_file" fi done -- cgit v1.2.3