Просмотр исходного кода

Backup and restore Tor settings

Bob Mottram 9 лет назад
Родитель
Сommit
802358b9a2

+ 1
- 0
src/freedombone-backup-local Просмотреть файл

@@ -359,6 +359,7 @@ function backup_directories {
359 359
         "/var/www/${HUBZILLA_DOMAIN_NAME},   hubzilla,   /root/temphubzilladata,                          hubzilladata"
360 360
         "none,                               none,       /var/www/${HUBZILLA_DOMAIN_NAME}/htdocs,         hubzilla"
361 361
         "none,                               none,       /var/www/${FULLBLOG_DOMAIN_NAME}/htdocs,         blog"
362
+        "none,                               none,       /var/lib/tor,                                    tor"
362 363
     )
363 364
 
364 365
     for dr in "${backup_dirs[@]}"

+ 8
- 0
src/freedombone-backup-remote Просмотреть файл

@@ -254,6 +254,13 @@ function backup_letsencrypt {
254 254
     fi
255 255
 }
256 256
 
257
+function backup_tor {
258
+    if [ -d /etc/letsencrypt ]; then
259
+        echo $"Backing up Tor settings"
260
+        backup_directory_to_friend /var/lib/tor tor
261
+    fi
262
+}
263
+
257 264
 function backup_gnusocial {
258 265
     if grep -q "GNU Social domain" $COMPLETION_FILE; then
259 266
         MICROBLOG_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "GNU Social domain" | awk -F ':' '{print $2}')
@@ -557,6 +564,7 @@ backup_configuration
557 564
 if [[ $TEST_MODE == "no" ]]; then
558 565
     backup_users
559 566
     backup_letsencrypt
567
+    backup_tor
560 568
     backup_gnusocial
561 569
     backup_hubzilla
562 570
     backup_owncloud

+ 13
- 0
src/freedombone-restore-local Просмотреть файл

@@ -335,6 +335,18 @@ function restore_letsencrypt {
335 335
     fi
336 336
 }
337 337
 
338
+function restore_tor {
339
+    if [[ $RESTORE_APP != 'all' ]]; then
340
+        if [[ $RESTORE_APP != 'tor' ]]; then
341
+            return
342
+        fi
343
+    fi
344
+    if [ -d $USB_MOUNT/backup/tor ]; then
345
+        echo $"Restoring Tor settings"
346
+        restore_directory_from_usb / tor
347
+    fi
348
+}
349
+
338 350
 function restore_mutt_settings {
339 351
     if [[ $RESTORE_APP != 'all' ]]; then
340 352
         if [[ $RESTORE_APP != 'mutt' ]]; then
@@ -977,6 +989,7 @@ same_admin_user
977 989
 update_domains
978 990
 restore_mariadb
979 991
 restore_letsencrypt
992
+restore_tor
980 993
 restore_mutt_settings
981 994
 restore_gpg
982 995
 restore_procmail

+ 12
- 0
src/freedombone-restore-remote Просмотреть файл

@@ -240,6 +240,18 @@ function restore_letsencrypt {
240 240
     fi
241 241
 }
242 242
 
243
+function restore_tor {
244
+    if [[ $RESTORE_APP != 'all' ]]; then
245
+        if [[ $RESTORE_APP != 'tor' ]]; then
246
+            return
247
+        fi
248
+    fi
249
+    if [ -d $SERVER_DIRECTORY/backup/tor ]; then
250
+        echo $"Restoring Tor settings"
251
+        restore_directory_from_friend / tor
252
+    fi
253
+}
254
+
243 255
 function restore_mutt_settings {
244 256
     if [[ $RESTORE_APP != 'all' ]]; then
245 257
         if [[ $RESTORE_APP != 'mutt' ]]; then