From d9ac4cb32401b5fc6a6f517b7f465f1f9d95ac8e Mon Sep 17 00:00:00 2001 From: Pecusx Date: Fri, 6 Jan 2017 16:37:00 +0100 Subject: [PATCH] Stationlist change - Experimental --- html/scripts/new_stationlist.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 html/scripts/new_stationlist.sh diff --git a/html/scripts/new_stationlist.sh b/html/scripts/new_stationlist.sh new file mode 100644 index 0000000..07dceaa --- /dev/null +++ b/html/scripts/new_stationlist.sh @@ -0,0 +1,21 @@ +# Create new stationlist form a /var/lib/radiod/stationlist_new file +chmod -R 0777 /var/lib/radiod/* + +# Check for new stationlist file +if [ -f "/var/lib/radiod/stationlist_new" ] +then + # Remove old copy of stationlist file + rm -r /var/lib/radiod/stationlist_old + # Rename current stationlist file - make old copy + mv /var/lib/radiod/stationlist /var/lib/radiod/stationlist_old + # Rename new stationlist file - make current stationlist + mv /var/lib/radiod/stationlist_new /var/lib/radiod/stationlist + # Call python script to make playlist from stationlist file + python /usr/share/radio/create_m3u.py --delete_old + echo "$file found." +else + echo "stationlist_new not found." +fi + +# Reastart PiRadio +service radiod restart