浏览代码

Move gnusocial local restore to app script

Bob Mottram 8 年前
父节点
当前提交
781453c7fe
共有 2 个文件被更改,包括 29 次插入23 次删除
  1. 29
    0
      src/freedombone-app-gnusocial
  2. 0
    23
      src/freedombone-restore-local

+ 29
- 0
src/freedombone-app-gnusocial 查看文件

109
 	fi
109
 	fi
110
 }
110
 }
111
 
111
 
112
+function restore_local_gnusocial {
113
+	if ! grep -q "GNU Social domain" $COMPLETION_FILE; then
114
+		return
115
+	fi
116
+	MICROBLOG_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "GNU Social domain" | awk -F ':' '{print $2}')
117
+	if [ $MICROBLOG_DOMAIN_NAME ]; then
118
+		echo $"Restoring GNU Social"
119
+		temp_restore_dir=/root/tempgnusocial
120
+		gnusocial_dir=/var/www/${MICROBLOG_DOMAIN_NAME}/htdocs
121
+		# stop the daemons
122
+		cd $gnusocial_dir
123
+		scripts/stopdaemons.sh
124
+
125
+		restore_database gnusocial ${MICROBLOG_DOMAIN_NAME}
126
+		if [ -d $temp_restore_dir ]; then
127
+			rm -rf $temp_restore_dir
128
+		fi
129
+
130
+		# start the daemons
131
+		cd $gnusocial_dir
132
+		scripts/startdaemons.sh
133
+		echo $"Restore of GNU Social complete"
134
+	fi
135
+}
136
+
112
 function backup_remote_gnusocial {
137
 function backup_remote_gnusocial {
113
 	echo -n ''
138
 	echo -n ''
114
 }
139
 }
115
 
140
 
141
+function restore_remote_gnusocial {
142
+	echo -n ''
143
+}
144
+
116
 function remove_gnusocial {
145
 function remove_gnusocial {
117
 	if ! grep -Fxq "install_gnusocial" $COMPLETION_FILE; then
146
 	if ! grep -Fxq "install_gnusocial" $COMPLETION_FILE; then
118
 		return
147
 		return

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

818
     fi
818
     fi
819
 }
819
 }
820
 
820
 
821
-function restore_gnusocial {
822
-    if [[ $RESTORE_APP != 'all' ]]; then
823
-        if [[ $RESTORE_APP != 'gnusocial' ]]; then
824
-            return
825
-        fi
826
-    fi
827
-    if [ $MICROBLOG_DOMAIN_NAME ]; then
828
-        # stop the daemons
829
-        cd /var/www/${MICROBLOG_DOMAIN_NAME}/htdocs
830
-        scripts/stopdaemons.sh
831
-
832
-        restore_database gnusocial ${MICROBLOG_DOMAIN_NAME}
833
-        if [ -d /root/tempgnusocial ]; then
834
-            rm -rf /root/tempgnusocial
835
-        fi
836
-
837
-        # start the daemons
838
-        cd /var/www/${MICROBLOG_DOMAIN_NAME}/htdocs
839
-        scripts/startdaemons.sh
840
-    fi
841
-}
842
-
843
 function restore_email {
821
 function restore_email {
844
     if [[ $RESTORE_APP != 'all' ]]; then
822
     if [[ $RESTORE_APP != 'all' ]]; then
845
         if [[ $RESTORE_APP != 'email' ]]; then
823
         if [[ $RESTORE_APP != 'email' ]]; then
929
 
907
 
930
 restore_ipfs
908
 restore_ipfs
931
 restore_xmpp
909
 restore_xmpp
932
-restore_gnusocial
933
 
910
 
934
 restore_email
911
 restore_email
935
 restore_apps
912
 restore_apps