Move local mumble restore to app script

This commit is contained in:
Bob Mottram 2016-07-08 16:26:18 +01:00
parent 44c3d087cd
commit bda2f9919d
2 changed files with 37 additions and 34 deletions

View File

@ -57,8 +57,44 @@ function backup_local_mumble {
fi
}
function restore_local_mumble {
if [ -d $USB_MOUNT/backup/voip ]; then
echo $"Restoring VoIP settings"
temp_restore_dir=/root/tempvoip
function_check restore_directory_from_usb
restore_directory_from_usb $temp_restore_dir voip
cp -f $temp_restore_dir/home/$ADMIN_USERNAME/tempbackup/mumble-server.ini /etc/
if [ ! "$?" = "0" ]; then
rm -rf $temp_restore_dir
function_check set_user_permissions
set_user_permissions
function_check backup_unmount_drive
backup_unmount_drive
exit 3679
fi
cp -f $temp_restore_dir/home/$ADMIN_USERNAME/tempbackup/mumble-server.sqlite /var/lib/mumble-server/
if [ ! "$?" = "0" ]; then
rm -rf $temp_restore_dir
function_check set_user_permissions
set_user_permissions
function_check backup_unmount_drive
backup_unmount_drive
exit 276
fi
rm -rf $temp_restore_dir
cp /etc/ssl/certs/mumble* /var/lib/mumble-server
cp /etc/ssl/private/mumble* /var/lib/mumble-server
chown -R mumble-server:mumble-server /var/lib/mumble-server
service mumble-server restart
fi
}
function backup_remote_mumble {
echo ''
echo -n ''
}
function restore_remote_mumble {
echo -n ''
}
function remove_mumble {

View File

@ -1185,38 +1185,6 @@ function restore_dlna {
fi
}
function restore_voip {
if [[ $RESTORE_APP != 'all' ]]; then
if [[ $RESTORE_APP != 'voip' ]]; then
return
fi
fi
if [ -d $USB_MOUNT/backup/voip ]; then
echo $"Restoring VoIP settings"
temp_restore_dir=/root/tempvoip
restore_directory_from_usb $temp_restore_dir voip
cp -f $temp_restore_dir/home/$ADMIN_USERNAME/tempbackup/mumble-server.ini /etc/
if [ ! "$?" = "0" ]; then
rm -rf $temp_restore_dir
set_user_permissions
backup_unmount_drive
exit 3679
fi
cp -f $temp_restore_dir/home/$ADMIN_USERNAME/tempbackup/mumble-server.sqlite /var/lib/mumble-server/
if [ ! "$?" = "0" ]; then
rm -rf $temp_restore_dir
set_user_permissions
backup_unmount_drive
exit 276
fi
rm -rf $temp_restore_dir
cp /etc/ssl/certs/mumble* /var/lib/mumble-server
cp /etc/ssl/private/mumble* /var/lib/mumble-server
chown -R mumble-server:mumble-server /var/lib/mumble-server
service mumble-server restart
fi
}
function get_restore_app {
if [ ${1} ]; then
if [ ! -d /home/${1} ]; then
@ -1287,7 +1255,6 @@ restore_blog
restore_cjdns
restore_email
restore_dlna
restore_voip
restore_apps
set_user_permissions