瀏覽代碼

Move remote xmpp restore to app script

Bob Mottram 8 年之前
父節點
當前提交
7b9e386455
共有 2 個檔案被更改,包括 14 行新增22 行删除
  1. 14
    1
      src/freedombone-app-xmpp
  2. 0
    21
      src/freedombone-restore-remote

+ 14
- 1
src/freedombone-app-xmpp 查看文件

@@ -150,7 +150,20 @@ function backup_remote_xmpp {
150 150
 }
151 151
 
152 152
 function restore_remote_xmpp {
153
-	echo -n ''
153
+	if [ -d /var/lib/prosody ]; then
154
+		echo $"Restoring XMPP settings"
155
+		temp_restore_dir=/root/tempxmpp
156
+		function_check restore_directory_from_friend
157
+		restore_directory_from_friend $temp_restore_dir xmpp
158
+		cp -r $temp_restore_dir/var/lib/prosody/* /var/lib/prosody
159
+		if [ ! "$?" = "0" ]; then
160
+			exit 725
161
+		fi
162
+		rm -rf $temp_restore_dir
163
+		service prosody restart
164
+		chown -R prosody:prosody /var/lib/prosody/*
165
+		echo $"Restore of XMPP settings complete"
166
+	fi
154 167
 }
155 168
 
156 169
 function configure_firewall_for_xmpp {

+ 0
- 21
src/freedombone-restore-remote 查看文件

@@ -666,26 +666,6 @@ function restore_mailing_list {
666 666
 	fi
667 667
 }
668 668
 
669
-function restore_xmpp {
670
-	if [[ $RESTORE_APP != 'all' ]]; then
671
-		if [[ $RESTORE_APP != 'xmpp' ]]; then
672
-			return
673
-		fi
674
-	fi
675
-	if [ -d /var/lib/prosody ]; then
676
-		echo $"Restoring XMPP settings"
677
-		temp_restore_dir=/root/tempxmpp
678
-		restore_directory_from_friend $temp_restore_dir xmpp
679
-		cp -r $temp_restore_dir/var/lib/prosody/* /var/lib/prosody
680
-		if [ ! "$?" = "0" ]; then
681
-			exit 725
682
-		fi
683
-		rm -rf $temp_restore_dir
684
-		service prosody restart
685
-		chown -R prosody:prosody /var/lib/prosody/*
686
-	fi
687
-}
688
-
689 669
 function restore_gnusocial {
690 670
 	if [[ $RESTORE_APP != 'all' ]]; then
691 671
 		if [[ $RESTORE_APP != 'gnusocial' ]]; then
@@ -1118,7 +1098,6 @@ restore_personal_settings
1118 1098
 restore_mailing_list
1119 1099
 restore_email
1120 1100
 
1121
-restore_xmpp
1122 1101
 restore_gnusocial
1123 1102
 restore_hubzilla
1124 1103
 restore_rss