소스 검색

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,10 +109,39 @@ function backup_local_gnusocial {
109 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 137
 function backup_remote_gnusocial {
113 138
 	echo -n ''
114 139
 }
115 140
 
141
+function restore_remote_gnusocial {
142
+	echo -n ''
143
+}
144
+
116 145
 function remove_gnusocial {
117 146
 	if ! grep -Fxq "install_gnusocial" $COMPLETION_FILE; then
118 147
 		return

+ 0
- 23
src/freedombone-restore-local 파일 보기

@@ -818,28 +818,6 @@ function restore_xmpp {
818 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 821
 function restore_email {
844 822
     if [[ $RESTORE_APP != 'all' ]]; then
845 823
         if [[ $RESTORE_APP != 'email' ]]; then
@@ -929,7 +907,6 @@ restore_mailing_list
929 907
 
930 908
 restore_ipfs
931 909
 restore_xmpp
932
-restore_gnusocial
933 910
 
934 911
 restore_email
935 912
 restore_apps