Backup and restore the icecast playlist
This commit is contained in:
parent
94b1d56ccf
commit
945ca4180d
|
@ -391,22 +391,23 @@ function backup_local_icecast {
|
|||
if [ ! -d $ICECAST_DIR ]; then
|
||||
return
|
||||
fi
|
||||
systemctl stop icecast2
|
||||
stop_icecast
|
||||
|
||||
cp /etc/nginx/.icepasswd $ICECAST_DIR
|
||||
cp /etc/ices2/ices-playlist.xml $ICECAST_DIR
|
||||
|
||||
function_check backup_directory_to_usb
|
||||
backup_directory_to_usb $ICECAST_DIR icecast
|
||||
|
||||
rm $ICECAST_DIR/.icepasswd
|
||||
systemctl start icecast2
|
||||
start_icecast
|
||||
}
|
||||
|
||||
function restore_local_icecast {
|
||||
if [ ! -d $ICECAST_DIR ]; then
|
||||
return
|
||||
fi
|
||||
systemctl stop icecast2
|
||||
stop_icecast
|
||||
temp_restore_dir=/root/tempicecast
|
||||
function_check restore_directory_from_usb
|
||||
restore_directory_from_usb $temp_restore_dir icecast
|
||||
|
@ -417,9 +418,12 @@ function restore_local_icecast {
|
|||
fi
|
||||
cp $ICECAST_DIR/.icepasswd /etc/nginx/.icepasswd
|
||||
rm $ICECAST_DIR/.icepasswd
|
||||
cp $ICECAST_DIR/ices-playlist.xml /etc/ices2
|
||||
rm $ICECAST_DIR/ices-playlist.xml
|
||||
chown -R icecast2:icecast $ICECAST_DIR
|
||||
chown -R icecast2:icecast /etc/ices2
|
||||
|
||||
systemctl start icecast2
|
||||
start_icecast
|
||||
rm -rf $temp_restore_dir
|
||||
}
|
||||
|
||||
|
@ -427,22 +431,23 @@ function backup_remote_icecast {
|
|||
if [ ! -d $ICECAST_DIR ]; then
|
||||
return
|
||||
fi
|
||||
systemctl stop icecast2
|
||||
stop_icecast
|
||||
|
||||
cp /etc/nginx/.icepasswd $ICECAST_DIR
|
||||
cp /etc/ices2/ices-playlist.xml $ICECAST_DIR
|
||||
|
||||
function_check backup_directory_to_friend
|
||||
backup_directory_to_friend $ICECAST_DIR icecast
|
||||
|
||||
rm $ICECAST_DIR/.icepasswd
|
||||
systemctl start icecast2
|
||||
start_icecast
|
||||
}
|
||||
|
||||
function restore_remote_icecast {
|
||||
if [ ! -d $ICECAST_DIR ]; then
|
||||
return
|
||||
fi
|
||||
systemctl stop icecast2
|
||||
stop_icecast
|
||||
temp_restore_dir=/root/tempicecast
|
||||
function_check restore_directory_from_friend
|
||||
restore_directory_from_friend $temp_restore_dir icecast
|
||||
|
@ -453,9 +458,11 @@ function restore_remote_icecast {
|
|||
fi
|
||||
cp $ICECAST_DIR/.icepasswd /etc/nginx/.icepasswd
|
||||
rm $ICECAST_DIR/.icepasswd
|
||||
cp $ICECAST_DIR/ices-playlist.xml /etc/ices2
|
||||
rm $ICECAST_DIR/ices-playlist.xml
|
||||
chown -R icecast2:icecast $ICECAST_DIR
|
||||
|
||||
systemctl start icecast2
|
||||
start_icecast
|
||||
rm -rf $temp_restore_dir
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue