Skip to content
Snippets Groups Projects
Commit 81828265 authored by Bob Mottram's avatar Bob Mottram
Browse files

Backup and restore password store

parent 4f778545
No related branches found
No related tags found
No related merge requests found
......@@ -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[@]}"
......
......@@ -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
......
......@@ -887,6 +887,7 @@ function restore_data_from_storage {
utils_installed=(configfiles
mariadb
letsencrypt
passwords
mutt
gpg
procmail
......
......@@ -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
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment