Sfoglia il codice sorgente

Move remote xmpp restore to app script

Bob Mottram 8 anni fa
parent
commit
7b9e386455
2 ha cambiato i file con 14 aggiunte e 22 eliminazioni
  1. 14
    1
      src/freedombone-app-xmpp
  2. 0
    21
      src/freedombone-restore-remote

+ 14
- 1
src/freedombone-app-xmpp Vedi File

150
 }
150
 }
151
 
151
 
152
 function restore_remote_xmpp {
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
 function configure_firewall_for_xmpp {
169
 function configure_firewall_for_xmpp {

+ 0
- 21
src/freedombone-restore-remote Vedi File

666
 	fi
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
 function restore_gnusocial {
669
 function restore_gnusocial {
690
 	if [[ $RESTORE_APP != 'all' ]]; then
670
 	if [[ $RESTORE_APP != 'all' ]]; then
691
 		if [[ $RESTORE_APP != 'gnusocial' ]]; then
671
 		if [[ $RESTORE_APP != 'gnusocial' ]]; then
1118
 restore_mailing_list
1098
 restore_mailing_list
1119
 restore_email
1099
 restore_email
1120
 
1100
 
1121
-restore_xmpp
1122
 restore_gnusocial
1101
 restore_gnusocial
1123
 restore_hubzilla
1102
 restore_hubzilla
1124
 restore_rss
1103
 restore_rss