Backup and Restore station list added to webinterface.

This commit is contained in:
Pecusx
2018-05-20 16:54:49 +02:00
parent c9afd94c33
commit 0135bf40e2
6 changed files with 138 additions and 4 deletions
+29
View File
@@ -0,0 +1,29 @@
# Restore station list from file
# Only if 1 params
if [ $# = 1 ]; then
# Get parameter from commandline
# "unpack" or "apply"
OPTION=$1
# Unpack or apply
if [ ${OPTION} = "unpack" ]; then
# prepare temp folder
rm -r /tmp/radiod/config
mkdir /tmp/radiod/config
# Unpack configuration
cd /tmp/radiod/config
tar -zxf /tmp/piradio.stl
# remove station list backup file
rm /tmp/piradio.stl
elif [ ${OPTION} = "apply" ]; then
# PiRadio statiolist file
cp /tmp/radiod/config/radiod/stationlist /var/lib/radiod/
# MPD playlists
rm /var/lib/mpd/playlists/*
cp /tmp/radiod/config/playlists/* /var/lib/mpd/playlists/
# clear temp
rm -r /tmp/radiod/config
fi
fi