Pārlūkot izejas kodu

Move hubzilla local restore to app script

Bob Mottram 8 gadus atpakaļ
vecāks
revīzija
f19b65bd8f
2 mainītis faili ar 28 papildinājumiem un 22 dzēšanām
  1. 28
    0
      src/freedombone-app-hubzilla
  2. 0
    22
      src/freedombone-restore-local

+ 28
- 0
src/freedombone-app-hubzilla Parādīt failu

@@ -76,10 +76,38 @@ function backup_local_hubzilla {
76 76
 	fi
77 77
 }
78 78
 
79
+function restore_local_hubzilla {
80
+	if ! grep -q "Hubzilla domain" $COMPLETION_FILE; then
81
+		return
82
+	fi
83
+	HUBZILLA_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "Hubzilla domain" | awk -F ':' '{print $2}')
84
+	if [ $HUBZILLA_DOMAIN_NAME ]; then
85
+		echo $"Restoring Hubzilla"
86
+		temp_restore_dir=/root/temphubzilla
87
+		hubzilla_dir=/var/www/${HUBZILLA_DOMAIN_NAME}/htdocs
88
+		restore_database hubzilla ${HUBZILLA_DOMAIN_NAME}
89
+		if [ -d $USB_MOUNT/backup/hubzilla ]; then
90
+			if [ ! -d $hubzilla_dir/store/[data]/smarty3 ]; then
91
+				mkdir -p $hubzilla_dir/store/[data]/smarty3
92
+			fi
93
+			chmod 777 $hubzilla_dir/store/[data]/smarty3
94
+			chown -R www-data:www-data $hubzilla_dir/*
95
+			if [ -d $temp_restore_dir ]; then
96
+				rm -rf $temp_restore_dir
97
+			fi
98
+		fi
99
+		echo $"Restore of Hubzilla complete"
100
+	fi
101
+}
102
+
79 103
 function backup_remote_hubzilla {
80 104
 	echo -n ''
81 105
 }
82 106
 
107
+function restore_remote_hubzilla {
108
+	echo -n ''
109
+}
110
+
83 111
 function remove_hubzilla {
84 112
 	if ! grep -Fxq "install_hubzilla" $COMPLETION_FILE; then
85 113
 		return

+ 0
- 22
src/freedombone-restore-local Parādīt failu

@@ -840,27 +840,6 @@ function restore_gnusocial {
840 840
     fi
841 841
 }
842 842
 
843
-function restore_hubzilla {
844
-    if [[ $RESTORE_APP != 'all' ]]; then
845
-        if [[ $RESTORE_APP != 'hubzilla' ]]; then
846
-            return
847
-        fi
848
-    fi
849
-    if [ $HUBZILLA_DOMAIN_NAME ]; then
850
-        restore_database hubzilla ${HUBZILLA_DOMAIN_NAME}
851
-        if [ -d $USB_MOUNT/backup/hubzilla ]; then
852
-            if [ ! -d /var/www/${HUBZILLA_DOMAIN_NAME}/htdocs/store/[data]/smarty3 ]; then
853
-                mkdir -p /var/www/${HUBZILLA_DOMAIN_NAME}/htdocs/store/[data]/smarty3
854
-            fi
855
-            chmod 777 /var/www/${HUBZILLA_DOMAIN_NAME}/htdocs/store/[data]/smarty3
856
-            chown -R www-data:www-data /var/www/${HUBZILLA_DOMAIN_NAME}/htdocs/*
857
-            if [ -d /root/temphubzilla ]; then
858
-                rm -rf /root/temphubzilla
859
-            fi
860
-        fi
861
-    fi
862
-}
863
-
864 843
 function restore_email {
865 844
     if [[ $RESTORE_APP != 'all' ]]; then
866 845
         if [[ $RESTORE_APP != 'email' ]]; then
@@ -951,7 +930,6 @@ restore_mailing_list
951 930
 restore_ipfs
952 931
 restore_xmpp
953 932
 restore_gnusocial
954
-restore_hubzilla
955 933
 
956 934
 restore_email
957 935
 restore_apps