Sfoglia il codice sorgente

Move hubzilla local restore to app script

Bob Mottram 8 anni fa
parent
commit
f19b65bd8f
2 ha cambiato i file con 28 aggiunte e 22 eliminazioni
  1. 28
    0
      src/freedombone-app-hubzilla
  2. 0
    22
      src/freedombone-restore-local

+ 28
- 0
src/freedombone-app-hubzilla Vedi File

76
 	fi
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
 function backup_remote_hubzilla {
103
 function backup_remote_hubzilla {
80
 	echo -n ''
104
 	echo -n ''
81
 }
105
 }
82
 
106
 
107
+function restore_remote_hubzilla {
108
+	echo -n ''
109
+}
110
+
83
 function remove_hubzilla {
111
 function remove_hubzilla {
84
 	if ! grep -Fxq "install_hubzilla" $COMPLETION_FILE; then
112
 	if ! grep -Fxq "install_hubzilla" $COMPLETION_FILE; then
85
 		return
113
 		return

+ 0
- 22
src/freedombone-restore-local Vedi File

840
     fi
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
 function restore_email {
843
 function restore_email {
865
     if [[ $RESTORE_APP != 'all' ]]; then
844
     if [[ $RESTORE_APP != 'all' ]]; then
866
         if [[ $RESTORE_APP != 'email' ]]; then
845
         if [[ $RESTORE_APP != 'email' ]]; then
951
 restore_ipfs
930
 restore_ipfs
952
 restore_xmpp
931
 restore_xmpp
953
 restore_gnusocial
932
 restore_gnusocial
954
-restore_hubzilla
955
 
933
 
956
 restore_email
934
 restore_email
957
 restore_apps
935
 restore_apps