From 22da3b7a00883ab2af82a0e3ad9ed6022bfc0f60 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 30 Oct 2016 14:13:11 +0000 Subject: [PATCH] Restoring wiki from backup --- src/freedombone-app-dokuwiki | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/freedombone-app-dokuwiki b/src/freedombone-app-dokuwiki index 7216fedd..6f86ec7a 100755 --- a/src/freedombone-app-dokuwiki +++ b/src/freedombone-app-dokuwiki @@ -93,9 +93,12 @@ function restore_local_dokuwiki { DOKUWIKI_DOMAIN_NAME=$(get_completion_param "dokuwiki domain") temp_restore_dir=/root/tempdokuwiki function_check restore_directory_from_usb - restore_directory_from_usb $temp_restore_dir wiki - restore_directory_from_usb $temp_restore_dir dokuwiki - cp -r $temp_restore_dir/var/lib/dokuwiki/* /var/lib/dokuwiki/ + if [ -d ${USB_MOUNT}/backup/wiki ]; then + restore_directory_from_usb ${temp_restore_dir} wiki + else + restore_directory_from_usb ${temp_restore_dir} dokuwiki + fi + cp -r ${temp_restore_dir}/var/lib/dokuwiki/* /var/lib/dokuwiki/ if [ ! "$?" = "0" ]; then function_check restore_directory_from_usb set_user_permissions @@ -103,7 +106,11 @@ function restore_local_dokuwiki { backup_unmount_drive exit 868 fi - restore_directory_from_usb ${temp_restore_dir}2 dokuwiki2 + if [ -d ${USB_MOUNT}/backup/wiki2 ]; then + restore_directory_from_usb ${temp_restore_dir}2 wiki2 + else + restore_directory_from_usb ${temp_restore_dir}2 dokuwiki2 + fi cp -r ${temp_restore_dir}2/etc/dokuwiki/* /etc/dokuwiki/ if [ ! "$?" = "0" ]; then function_check set_user_permissions @@ -112,10 +119,10 @@ function restore_local_dokuwiki { backup_unmount_drive exit 869 fi - rm -rf $temp_restore_dir + rm -rf ${temp_restore_dir} rm -rf ${temp_restore_dir}2 - rm -rf /var/lib/dokuwiki/data/cache/* - rm -rf /var/lib/dokuwiki/data/meta/* + #rm -rf /var/lib/dokuwiki/data/cache/* + #rm -rf /var/lib/dokuwiki/data/meta/* chmod -R 755 /var/lib/dokuwiki/data chown -R www-data:www-data /var/lib/dokuwiki/data chown -R www-data:www-data /var/lib/dokuwiki/* @@ -157,8 +164,8 @@ function restore_remote_dokuwiki { fi rm -rf /root/tempdokuwiki rm -rf /root/tempdokuwiki2 - rm -rf /var/lib/dokuwiki/data/cache/* - rm -rf /var/lib/dokuwiki/data/meta/* + #rm -rf /var/lib/dokuwiki/data/cache/* + #rm -rf /var/lib/dokuwiki/data/meta/* chmod -R 755 /var/lib/dokuwiki/data chown -R www-data:www-data /var/lib/dokuwiki/data chown -R www-data:www-data /var/lib/dokuwiki/*