Parcourir la source

Move rss local restore to app script

Bob Mottram il y a 9 ans
Parent
révision
e2ad22bd2d
2 fichiers modifiés avec 23 ajouts et 18 suppressions
  1. 23
    0
      src/freedombone-app-rss
  2. 0
    18
      src/freedombone-restore-local

+ 23
- 0
src/freedombone-app-rss Voir le fichier

@@ -97,10 +97,33 @@ function backup_local_rss {
97 97
 	fi
98 98
 }
99 99
 
100
+function restore_local_rss {
101
+	if ! grep -q "RSS reader domain" $COMPLETION_FILE; then
102
+		return
103
+	fi
104
+	RSS_READER_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "RSS reader domain" | awk -F ':' '{print $2}')
105
+	if [ $RSS_READER_DOMAIN_NAME ]; then
106
+		echo $"Restoring ttrss"
107
+		temp_restore_dir=/root/tempttrss
108
+		restore_database ttrss ${RSS_READER_DOMAIN_NAME}
109
+		if [ -d $USB_MOUNT/backup/ttrss ]; then
110
+			chown -R www-data:www-data /etc/share/tt-rss
111
+			if [ -d $temp_restore_dir ]; then
112
+				rm -rf $temp_restore_dir
113
+			fi
114
+		fi
115
+		echo $"Restore of ttrss complete"
116
+	fi
117
+}
118
+
100 119
 function backup_remote_rss {
101 120
 	echo -n ''
102 121
 }
103 122
 
123
+function restore_remote_rss {
124
+	echo -n ''
125
+}
126
+
104 127
 function remove_rss {
105 128
 	if ! grep -Fxq "install_rss" $COMPLETION_FILE; then
106 129
 		return

+ 0
- 18
src/freedombone-restore-local Voir le fichier

@@ -840,23 +840,6 @@ function restore_gnusocial {
840 840
     fi
841 841
 }
842 842
 
843
-function restore_rss {
844
-    if [[ $RESTORE_APP != 'all' ]]; then
845
-        if [[ $RESTORE_APP != 'ttrss' ]]; then
846
-            return
847
-        fi
848
-    fi
849
-    if [ $RSS_READER_DOMAIN_NAME ]; then
850
-        restore_database ttrss ${RSS_READER_DOMAIN_NAME}
851
-        if [ -d $USB_MOUNT/backup/ttrss ]; then
852
-            chown -R www-data:www-data /etc/share/tt-rss
853
-            if [ -d /root/tempttrss ]; then
854
-                rm -rf /root/tempttrss
855
-            fi
856
-        fi
857
-    fi
858
-}
859
-
860 843
 function restore_hubzilla {
861 844
     if [[ $RESTORE_APP != 'all' ]]; then
862 845
         if [[ $RESTORE_APP != 'hubzilla' ]]; then
@@ -969,7 +952,6 @@ restore_ipfs
969 952
 restore_xmpp
970 953
 restore_gnusocial
971 954
 restore_hubzilla
972
-restore_rss
973 955
 
974 956
 restore_email
975 957
 restore_apps