Browse Source

Move remote gnusocial restore to app script

Bob Mottram 8 years ago
parent
commit
26f3340120
2 changed files with 19 additions and 26 deletions
  1. 19
    1
      src/freedombone-app-gnusocial
  2. 0
    25
      src/freedombone-restore-remote

+ 19
- 1
src/freedombone-app-gnusocial View File

@@ -163,7 +163,25 @@ function backup_remote_gnusocial {
163 163
 }
164 164
 
165 165
 function restore_remote_gnusocial {
166
-	echo -n ''
166
+	if grep -q "GNU Social domain" $COMPLETION_FILE; then
167
+		echo $"Restoring GNU Social"
168
+		MICROBLOG_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "GNU Social domain" | awk -F ':' '{print $2}')
169
+
170
+		# stop the daemons
171
+		cd /var/www/${MICROBLOG_DOMAIN_NAME}/htdocs
172
+		scripts/stopdaemons.sh
173
+
174
+		function_check restore_database_from_friend
175
+		restore_database_from_friend gnusocial ${MICROBLOG_DOMAIN_NAME}
176
+		if [ -d /root/tempgnusocial ]; then
177
+			rm -rf /root/tempgnusocial
178
+		fi
179
+
180
+		# start the daemons
181
+		cd /var/www/${MICROBLOG_DOMAIN_NAME}/htdocs
182
+		scripts/startdaemons.sh
183
+		echo $"Restore of GNU Social complete"
184
+	fi
167 185
 }
168 186
 
169 187
 function remove_gnusocial {

+ 0
- 25
src/freedombone-restore-remote View File

@@ -666,30 +666,6 @@ function restore_mailing_list {
666 666
 	fi
667 667
 }
668 668
 
669
-function restore_gnusocial {
670
-	if [[ $RESTORE_APP != 'all' ]]; then
671
-		if [[ $RESTORE_APP != 'gnusocial' ]]; then
672
-			return
673
-		fi
674
-	fi
675
-	if grep -q "GNU Social domain" $COMPLETION_FILE; then
676
-		MICROBLOG_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "GNU Social domain" | awk -F ':' '{print $2}')
677
-
678
-		# stop the daemons
679
-		cd /var/www/${MICROBLOG_DOMAIN_NAME}/htdocs
680
-		scripts/stopdaemons.sh
681
-
682
-		restore_database_from_friend gnusocial ${MICROBLOG_DOMAIN_NAME}
683
-		if [ -d /root/tempgnusocial ]; then
684
-			rm -rf /root/tempgnusocial
685
-		fi
686
-
687
-		# start the daemons
688
-		cd /var/www/${MICROBLOG_DOMAIN_NAME}/htdocs
689
-		scripts/startdaemons.sh
690
-	fi
691
-}
692
-
693 669
 function restore_rss {
694 670
 	if [[ $RESTORE_APP != 'all' ]]; then
695 671
 		if [[ $RESTORE_APP != 'ttrss' ]]; then
@@ -1098,7 +1074,6 @@ restore_personal_settings
1098 1074
 restore_mailing_list
1099 1075
 restore_email
1100 1076
 
1101
-restore_gnusocial
1102 1077
 restore_hubzilla
1103 1078
 restore_rss
1104 1079
 restore_syncthing