From 7b9e386455ef32885aeb20ba299c60f20d30bbf9 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 10 Jul 2016 13:13:05 +0100 Subject: [PATCH] Move remote xmpp restore to app script --- src/freedombone-app-xmpp | 15 ++++++++++++++- src/freedombone-restore-remote | 21 --------------------- 2 files changed, 14 insertions(+), 22 deletions(-) diff --git a/src/freedombone-app-xmpp b/src/freedombone-app-xmpp index 15c0ba5d..f32df760 100755 --- a/src/freedombone-app-xmpp +++ b/src/freedombone-app-xmpp @@ -150,7 +150,20 @@ function backup_remote_xmpp { } function restore_remote_xmpp { - echo -n '' + if [ -d /var/lib/prosody ]; then + echo $"Restoring XMPP settings" + temp_restore_dir=/root/tempxmpp + function_check restore_directory_from_friend + restore_directory_from_friend $temp_restore_dir xmpp + cp -r $temp_restore_dir/var/lib/prosody/* /var/lib/prosody + if [ ! "$?" = "0" ]; then + exit 725 + fi + rm -rf $temp_restore_dir + service prosody restart + chown -R prosody:prosody /var/lib/prosody/* + echo $"Restore of XMPP settings complete" + fi } function configure_firewall_for_xmpp { diff --git a/src/freedombone-restore-remote b/src/freedombone-restore-remote index 0e3f8107..b659f670 100755 --- a/src/freedombone-restore-remote +++ b/src/freedombone-restore-remote @@ -666,26 +666,6 @@ function restore_mailing_list { fi } -function restore_xmpp { - if [[ $RESTORE_APP != 'all' ]]; then - if [[ $RESTORE_APP != 'xmpp' ]]; then - return - fi - fi - if [ -d /var/lib/prosody ]; then - echo $"Restoring XMPP settings" - temp_restore_dir=/root/tempxmpp - restore_directory_from_friend $temp_restore_dir xmpp - cp -r $temp_restore_dir/var/lib/prosody/* /var/lib/prosody - if [ ! "$?" = "0" ]; then - exit 725 - fi - rm -rf $temp_restore_dir - service prosody restart - chown -R prosody:prosody /var/lib/prosody/* - fi -} - function restore_gnusocial { if [[ $RESTORE_APP != 'all' ]]; then if [[ $RESTORE_APP != 'gnusocial' ]]; then @@ -1118,7 +1098,6 @@ restore_personal_settings restore_mailing_list restore_email -restore_xmpp restore_gnusocial restore_hubzilla restore_rss