瀏覽代碼

Move remote hubzilla restore to app script

Bob Mottram 8 年之前
父節點
當前提交
908919e11d
共有 2 個檔案被更改,包括 17 行新增24 行删除
  1. 17
    1
      src/freedombone-app-hubzilla
  2. 0
    23
      src/freedombone-restore-remote

+ 17
- 1
src/freedombone-app-hubzilla 查看文件

122
 }
122
 }
123
 
123
 
124
 function restore_remote_hubzilla {
124
 function restore_remote_hubzilla {
125
-	echo -n ''
125
+	if grep -q "Hubzilla domain" $COMPLETION_FILE; then
126
+		echo $"Restoring Hubzilla"
127
+		HUBZILLA_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "Hubzilla domain" | awk -F ':' '{print $2}')
128
+		function_check restore_database_from_friend
129
+		restore_database_from_friend hubzilla ${HUBZILLA_DOMAIN_NAME}
130
+		if [ -d $SERVER_DIRECTORY/backup/hubzilla ]; then
131
+			if [ ! -d /var/www/${HUBZILLA_DOMAIN_NAME}/htdocs/store/[data]/smarty3 ]; then
132
+				mkdir -p /var/www/${HUBZILLA_DOMAIN_NAME}/htdocs/store/[data]/smarty3
133
+			fi
134
+			chmod 777 /var/www/${HUBZILLA_DOMAIN_NAME}/htdocs/store/[data]/smarty3
135
+			chown -R www-data:www-data /var/www/${HUBZILLA_DOMAIN_NAME}/htdocs/*
136
+		fi
137
+		if [ -d /root/temphubzilla ]; then
138
+			rm -rf /root/temphubzilla
139
+		fi
140
+		echo $"Restore of Hubzilla complete"
141
+	fi
126
 }
142
 }
127
 
143
 
128
 function remove_hubzilla {
144
 function remove_hubzilla {

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

684
 	fi
684
 	fi
685
 }
685
 }
686
 
686
 
687
-function restore_hubzilla {
688
-	if [[ $RESTORE_APP != 'all' ]]; then
689
-		if [[ $RESTORE_APP != 'hubzilla' ]]; then
690
-			return
691
-		fi
692
-	fi
693
-	if grep -q "Hubzilla domain" $COMPLETION_FILE; then
694
-		HUBZILLA_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "Hubzilla domain" | awk -F ':' '{print $2}')
695
-		restore_database_from_friend hubzilla ${HUBZILLA_DOMAIN_NAME}
696
-		if [ -d $SERVER_DIRECTORY/backup/hubzilla ]; then
697
-			if [ ! -d /var/www/${HUBZILLA_DOMAIN_NAME}/htdocs/store/[data]/smarty3 ]; then
698
-				mkdir -p /var/www/${HUBZILLA_DOMAIN_NAME}/htdocs/store/[data]/smarty3
699
-			fi
700
-			chmod 777 /var/www/${HUBZILLA_DOMAIN_NAME}/htdocs/store/[data]/smarty3
701
-			chown -R www-data:www-data /var/www/${HUBZILLA_DOMAIN_NAME}/htdocs/*
702
-		fi
703
-		if [ -d /root/temphubzilla ]; then
704
-			rm -rf /root/temphubzilla
705
-		fi
706
-	fi
707
-}
708
-
709
 function restore_syncthing {
687
 function restore_syncthing {
710
 	if [[ $RESTORE_APP != 'all' ]]; then
688
 	if [[ $RESTORE_APP != 'all' ]]; then
711
 		if [[ $RESTORE_APP != 'syncthing' ]]; then
689
 		if [[ $RESTORE_APP != 'syncthing' ]]; then
1074
 restore_mailing_list
1052
 restore_mailing_list
1075
 restore_email
1053
 restore_email
1076
 
1054
 
1077
-restore_hubzilla
1078
 restore_rss
1055
 restore_rss
1079
 restore_syncthing
1056
 restore_syncthing
1080
 restore_mediagoblin
1057
 restore_mediagoblin