Backup and restore Tor settings

This commit is contained in:
Bob Mottram 2015-12-29 17:41:22 +00:00
parent 4853e5e2f2
commit 802358b9a2
4 changed files with 34 additions and 0 deletions

View File

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

View File

@ -254,6 +254,13 @@ function backup_letsencrypt {
fi fi
} }
function backup_tor {
if [ -d /etc/letsencrypt ]; then
echo $"Backing up Tor settings"
backup_directory_to_friend /var/lib/tor tor
fi
}
function backup_gnusocial { function backup_gnusocial {
if grep -q "GNU Social domain" $COMPLETION_FILE; then if grep -q "GNU Social domain" $COMPLETION_FILE; then
MICROBLOG_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "GNU Social domain" | awk -F ':' '{print $2}') MICROBLOG_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "GNU Social domain" | awk -F ':' '{print $2}')
@ -557,6 +564,7 @@ backup_configuration
if [[ $TEST_MODE == "no" ]]; then if [[ $TEST_MODE == "no" ]]; then
backup_users backup_users
backup_letsencrypt backup_letsencrypt
backup_tor
backup_gnusocial backup_gnusocial
backup_hubzilla backup_hubzilla
backup_owncloud backup_owncloud

View File

@ -335,6 +335,18 @@ function restore_letsencrypt {
fi fi
} }
function restore_tor {
if [[ $RESTORE_APP != 'all' ]]; then
if [[ $RESTORE_APP != 'tor' ]]; then
return
fi
fi
if [ -d $USB_MOUNT/backup/tor ]; then
echo $"Restoring Tor settings"
restore_directory_from_usb / tor
fi
}
function restore_mutt_settings { function restore_mutt_settings {
if [[ $RESTORE_APP != 'all' ]]; then if [[ $RESTORE_APP != 'all' ]]; then
if [[ $RESTORE_APP != 'mutt' ]]; then if [[ $RESTORE_APP != 'mutt' ]]; then
@ -977,6 +989,7 @@ same_admin_user
update_domains update_domains
restore_mariadb restore_mariadb
restore_letsencrypt restore_letsencrypt
restore_tor
restore_mutt_settings restore_mutt_settings
restore_gpg restore_gpg
restore_procmail restore_procmail

View File

@ -240,6 +240,18 @@ function restore_letsencrypt {
fi fi
} }
function restore_tor {
if [[ $RESTORE_APP != 'all' ]]; then
if [[ $RESTORE_APP != 'tor' ]]; then
return
fi
fi
if [ -d $SERVER_DIRECTORY/backup/tor ]; then
echo $"Restoring Tor settings"
restore_directory_from_friend / tor
fi
}
function restore_mutt_settings { function restore_mutt_settings {
if [[ $RESTORE_APP != 'all' ]]; then if [[ $RESTORE_APP != 'all' ]]; then
if [[ $RESTORE_APP != 'mutt' ]]; then if [[ $RESTORE_APP != 'mutt' ]]; then