Bladeren bron

Remote restore for rss

Bob Mottram 9 jaren geleden
bovenliggende
commit
4875d2d7ed
1 gewijzigde bestanden met toevoegingen van 40 en 0 verwijderingen
  1. 40
    0
      src/freedombone-restore-remote

+ 40
- 0
src/freedombone-restore-remote Bestand weergeven

125
         restore_directory_from_friend /root/temp${1} ${1}
125
         restore_directory_from_friend /root/temp${1} ${1}
126
         RESTORE_SUBDIR="var"
126
         RESTORE_SUBDIR="var"
127
         if [ ${1} ]; then
127
         if [ ${1} ]; then
128
+
129
+            # special handling of ttrss
130
+            if [[ ${2} == "ttrss" ]]; then
131
+                if [ -d /etc/share/${2} ]; then
132
+                    rm -rf /etc/share/${2}
133
+                    mv /root/temp${1}/etc/share/${2} /etc/share/
134
+                    if [ ! "$?" = "0" ]; then
135
+                        exit 639
136
+                    fi
137
+                    if [ -d /etc/letsencrypt/live/${2} ]; then
138
+                        ln -s /etc/letsencrypt/live/${2}/privkey.pem /etc/ssl/private/${2}.key
139
+                        ln -s /etc/letsencrypt/live/${2}/fullchain.pem /etc/ssl/certs/${2}.pem
140
+                    else
141
+                        # Ensure that the bundled SSL cert is being used
142
+                        if [ -f /etc/ssl/certs/${2}.bundle.crt ]; then
143
+                            sed -i "s|${2}.crt|${2}.bundle.crt|g" /etc/nginx/sites-available/${2}
144
+                        fi
145
+                    fi
146
+                fi
147
+            fi
148
+
128
             if [ -d /var/www/${2}/htdocs ]; then
149
             if [ -d /var/www/${2}/htdocs ]; then
129
                 if [ -d /root/temp${1}/${RESTORE_SUBDIR}/www/${2}/htdocs ]; then
150
                 if [ -d /root/temp${1}/${RESTORE_SUBDIR}/www/${2}/htdocs ]; then
130
                     rm -rf /var/www/${2}/htdocs
151
                     rm -rf /var/www/${2}/htdocs
575
     fi
596
     fi
576
 }
597
 }
577
 
598
 
599
+function restore_rss_reader {
600
+    if [[ $RESTORE_APP != 'all' ]]; then
601
+        if [[ $RESTORE_APP != 'ttrss' ]]; then
602
+            return
603
+        fi
604
+    fi
605
+    if grep -q "RSS reader domain" $COMPLETION_FILE; then
606
+        RSS_READER_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "RSS reader domain" | awk -F ':' '{print $2}')
607
+        restore_database_from_friend ttrss ${RSS_READER_DOMAIN_NAME}
608
+        if [ -d $SERVER_DIRECTORY/backup/ttrss ]; then
609
+            chown -R www-data:www-data /etc/share/ttrss
610
+        fi
611
+        if [ -d /root/tempttrss ]; then
612
+            rm -rf /root/tempttrss
613
+        fi
614
+    fi
615
+}
616
+
578
 function restore_hubzilla {
617
 function restore_hubzilla {
579
     if [[ $RESTORE_APP != 'all' ]]; then
618
     if [[ $RESTORE_APP != 'all' ]]; then
580
         if [[ $RESTORE_APP != 'hubzilla' ]]; then
619
         if [[ $RESTORE_APP != 'hubzilla' ]]; then
886
 restore_xmpp
925
 restore_xmpp
887
 restore_gnu_social
926
 restore_gnu_social
888
 restore_hubzilla
927
 restore_hubzilla
928
+restore_rss_reader
889
 restore_owncloud
929
 restore_owncloud
890
 restore_gogs
930
 restore_gogs
891
 restore_wiki
931
 restore_wiki