浏览代码

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,7 +122,23 @@ function backup_remote_hubzilla {
122 122
 }
123 123
 
124 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 144
 function remove_hubzilla {

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

@@ -684,28 +684,6 @@ function restore_rss {
684 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 687
 function restore_syncthing {
710 688
 	if [[ $RESTORE_APP != 'all' ]]; then
711 689
 		if [[ $RESTORE_APP != 'syncthing' ]]; then
@@ -1074,7 +1052,6 @@ restore_personal_settings
1074 1052
 restore_mailing_list
1075 1053
 restore_email
1076 1054
 
1077
-restore_hubzilla
1078 1055
 restore_rss
1079 1056
 restore_syncthing
1080 1057
 restore_mediagoblin