Backup and restore password store

This commit is contained in:
Bob Mottram 2016-11-19 14:28:07 +00:00
parent 4f7785459a
commit 818282650c
5 changed files with 36 additions and 0 deletions

View File

@ -204,6 +204,7 @@ function backup_directories {
"/var/spool/mlmmj, mailinglist"
"/etc/nginx/sites-available, web"
"/var/lib/tor, tor"
"/root/.passwords, passwordstore"
)
for dr in "${backup_dirs[@]}"

View File

@ -249,6 +249,13 @@ function backup_letsencrypt {
fi
}
function backup_passwordstore {
if [ -d /root/.passwords ]; then
echo $"Backing up password store"
backup_directory_to_friend /root/.passwords passwordstore
fi
}
function backup_tor {
if [ -d /etc/letsencrypt ]; then
echo $"Backing up Tor settings"
@ -376,6 +383,7 @@ backup_configfiles
if [[ $TEST_MODE == "no" ]]; then
backup_users
backup_letsencrypt
backup_passwordstore
backup_tor
backup_web_server
backup_admin_readme

View File

@ -887,6 +887,7 @@ function restore_data_from_storage {
utils_installed=(configfiles
mariadb
letsencrypt
passwords
mutt
gpg
procmail

View File

@ -227,6 +227,18 @@ function restore_letsencrypt {
fi
}
function restore_passwordstore {
if [[ $RESTORE_APP != 'all' ]]; then
if [[ $RESTORE_APP != 'passwords' ]]; then
return
fi
fi
if [ -d $USB_MOUNT/backup/passwordstore ]; then
echo $"Restoring password store"
restore_directory_from_usb / passwordstore
fi
}
function restore_tor {
if [[ $RESTORE_APP != 'all' ]]; then
if [[ $RESTORE_APP != 'tor' ]]; then
@ -713,6 +725,7 @@ restore_configfiles
same_admin_user
restore_mariadb
restore_letsencrypt
restore_passwordstore
restore_tor
restore_mutt_settings
restore_gpg

View File

@ -219,6 +219,18 @@ function restore_letsencrypt {
fi
}
function restore_passwordstore {
if [[ $RESTORE_APP != 'all' ]]; then
if [[ $RESTORE_APP != 'passwords' ]]; then
return
fi
fi
if [ -d $SERVER_DIRECTORY/backup/passwordstore ]; then
echo $"Restoring password store"
restore_directory_from_friend / passwordstore
fi
}
function restore_tor {
if [[ $RESTORE_APP != 'all' ]]; then
if [[ $RESTORE_APP != 'tor' ]]; then
@ -649,6 +661,7 @@ copy_gpg_keys
restore_configfiles
restore_mariadb
restore_letsencrypt
restore_passwordstore
restore_mutt_settings
restore_gpg
restore_procmail