Move local cjdns restore to app script

This commit is contained in:
Bob Mottram 2016-07-08 16:38:26 +01:00
parent bda2f9919d
commit 3910ab6ac6
3 changed files with 52 additions and 48 deletions

View File

@ -117,11 +117,34 @@ function get_cjdns_password {
} }
function backup_local_cjdns { function backup_local_cjdns {
echo '' echo -n ''
}
function restore_local_cjdns {
if [ -d $USB_MOUNT/backup/cjdns ]; then
echo $"Restoring cjdns installation"
temp_restore_dir=/root/tempcjdns
function_check restore_directory_from_usb
restore_directory_from_usb $temp_restore_dir cjdns
rm -rf /etc/cjdns
cp -r $temp_restore_dir/etc/cjdns /etc/
if [ ! "$?" = "0" ]; then
function_check set_user_permissions
set_user_permissions
function_check backup_unmount_drive
backup_unmount_drive
exit 8472
fi
rm -rf $temp_restore_dir
fi
} }
function backup_remote_cjdns { function backup_remote_cjdns {
echo '' echo -n ''
}
function restore_remote_cjdns {
echo -n ''
} }
function remove_cjdns { function remove_cjdns {

View File

@ -65,8 +65,33 @@ function backup_local_dlna {
fi fi
} }
function restore_local_dlna {
if [ -d /var/cache/minidlna ]; then
if [ -d $USB_MOUNT/backup/dlna ]; then
echo $"Restoring DLNA cache"
temp_restore_dir=/root/tempdlna
function_check restore_directory_from_usb
restore_directory_from_usb $temp_restore_dir dlna
cp -r $temp_restore_dir/var/cache/minidlna/* /var/cache/minidlna/
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 982572
fi
rm -rf $temp_restore_dir
fi
fi
}
function backup_remote_dlna { function backup_remote_dlna {
echo '' echo -n ''
}
function restore_remote_dlna {
echo -n ''
} }
function remove_dlna { function remove_dlna {

View File

@ -1113,26 +1113,6 @@ function restore_blog {
fi fi
} }
function restore_cjdns {
if [[ $RESTORE_APP != 'all' ]]; then
if [[ $RESTORE_APP != 'cjdns' ]]; then
return
fi
fi
if [ -d $USB_MOUNT/backup/cjdns ]; then
echo $"Restoring cjdns installation"
restore_directory_from_usb /root/tempcjdns cjdns
rm -rf /etc/cjdns
cp -r /root/tempcjdns/etc/cjdns /etc/
if [ ! "$?" = "0" ]; then
set_user_permissions
backup_unmount_drive
exit 8472
fi
rm -rf /root/tempcjdns
fi
}
function restore_email { function restore_email {
if [[ $RESTORE_APP != 'all' ]]; then if [[ $RESTORE_APP != 'all' ]]; then
if [[ $RESTORE_APP != 'email' ]]; then if [[ $RESTORE_APP != 'email' ]]; then
@ -1163,28 +1143,6 @@ function restore_email {
fi fi
} }
function restore_dlna {
if [[ $RESTORE_APP != 'all' ]]; then
if [[ $RESTORE_APP != 'dlna' ]]; then
return
fi
fi
if [ -d /var/cache/minidlna ]; then
if [ -d $USB_MOUNT/backup/dlna ]; then
echo $"Restoring DLNA cache"
restore_directory_from_usb /root/tempdlna dlna
cp -r /root/tempdlna/var/cache/minidlna/* /var/cache/minidlna/
if [ ! "$?" = "0" ]; then
rm -rf /root/tempdlna
set_user_permissions
backup_unmount_drive
exit 982
fi
rm -rf /root/tempdlna
fi
fi
}
function get_restore_app { function get_restore_app {
if [ ${1} ]; then if [ ${1} ]; then
if [ ! -d /home/${1} ]; then if [ ! -d /home/${1} ]; then
@ -1252,10 +1210,8 @@ restore_mediagoblin
restore_gogs restore_gogs
restore_wiki restore_wiki
restore_blog restore_blog
restore_cjdns
restore_email
restore_dlna
restore_email
restore_apps restore_apps
set_user_permissions set_user_permissions
backup_unmount_drive backup_unmount_drive