Better naming to differentiate config files from user config
This commit is contained in:
parent
26e1713cbf
commit
a912e6cfc3
|
@ -243,7 +243,7 @@ function prepare_directories {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function backup_configuration {
|
function backup_configfiles {
|
||||||
echo $"Backing up ${PROJECT_NAME} configuration files"
|
echo $"Backing up ${PROJECT_NAME} configuration files"
|
||||||
temp_backup_dir=/root/tempbackupconfig
|
temp_backup_dir=/root/tempbackupconfig
|
||||||
if [ ! -d $temp_backup_dir ]; then
|
if [ ! -d $temp_backup_dir ]; then
|
||||||
|
@ -258,7 +258,7 @@ function backup_configuration {
|
||||||
if [ -f /etc/nginx/.htpasswd ]; then
|
if [ -f /etc/nginx/.htpasswd ]; then
|
||||||
cp -f /etc/nginx/.htpasswd $temp_backup_dir/htpasswd
|
cp -f /etc/nginx/.htpasswd $temp_backup_dir/htpasswd
|
||||||
fi
|
fi
|
||||||
backup_directory_to_usb $temp_backup_dir config
|
backup_directory_to_usb $temp_backup_dir configfiles
|
||||||
}
|
}
|
||||||
|
|
||||||
function backup_admin_readme {
|
function backup_admin_readme {
|
||||||
|
@ -307,7 +307,7 @@ backup_users
|
||||||
prepare_directories
|
prepare_directories
|
||||||
backup_directories
|
backup_directories
|
||||||
backup_apps local
|
backup_apps local
|
||||||
backup_configuration
|
backup_configfiles
|
||||||
backup_admin_readme
|
backup_admin_readme
|
||||||
backup_mariadb
|
backup_mariadb
|
||||||
backup_extra_directories local
|
backup_extra_directories local
|
||||||
|
|
|
@ -108,7 +108,7 @@ function restart_site {
|
||||||
SUSPENDED_SITE=
|
SUSPENDED_SITE=
|
||||||
}
|
}
|
||||||
|
|
||||||
function backup_configuration {
|
function backup_configfiles {
|
||||||
echo $"Backing up ${PROJECT_NAME} configuration files"
|
echo $"Backing up ${PROJECT_NAME} configuration files"
|
||||||
temp_backup_dir=/root/tempbackupconfig
|
temp_backup_dir=/root/tempbackupconfig
|
||||||
if [ ! -d $temp_backup_dir ]; then
|
if [ ! -d $temp_backup_dir ]; then
|
||||||
|
@ -123,7 +123,7 @@ function backup_configuration {
|
||||||
if [ -f /etc/nginx/.htpasswd ]; then
|
if [ -f /etc/nginx/.htpasswd ]; then
|
||||||
cp -f /etc/nginx/.htpasswd $temp_backup_dir/htpasswd
|
cp -f /etc/nginx/.htpasswd $temp_backup_dir/htpasswd
|
||||||
fi
|
fi
|
||||||
backup_directory_to_friend $temp_backup_dir config
|
backup_directory_to_friend $temp_backup_dir configfiles
|
||||||
}
|
}
|
||||||
|
|
||||||
function backup_users {
|
function backup_users {
|
||||||
|
@ -369,7 +369,7 @@ if [[ "$1" == "test" ]]; then
|
||||||
TEST_MODE="yes"
|
TEST_MODE="yes"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
backup_configuration
|
backup_configfiles
|
||||||
if [[ $TEST_MODE == "no" ]]; then
|
if [[ $TEST_MODE == "no" ]]; then
|
||||||
backup_users
|
backup_users
|
||||||
backup_letsencrypt
|
backup_letsencrypt
|
||||||
|
|
|
@ -892,7 +892,7 @@ function restore_data_from_storage {
|
||||||
restore_command="${PROJECT_NAME}-restore-local $USB_DRIVE"
|
restore_command="${PROJECT_NAME}-restore-local $USB_DRIVE"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
utils_installed=(config
|
utils_installed=(configfiles
|
||||||
mariadb
|
mariadb
|
||||||
letsencrypt
|
letsencrypt
|
||||||
mutt
|
mutt
|
||||||
|
|
|
@ -95,9 +95,9 @@ function copy_gpg_keys {
|
||||||
cp -r /home/$ADMIN_USERNAME/.gnupg /root
|
cp -r /home/$ADMIN_USERNAME/.gnupg /root
|
||||||
}
|
}
|
||||||
|
|
||||||
function restore_config {
|
function restore_configfiles {
|
||||||
if [[ $RESTORE_APP != 'all' ]]; then
|
if [[ $RESTORE_APP != 'all' ]]; then
|
||||||
if [[ $RESTORE_APP != 'config' ]]; then
|
if [[ $RESTORE_APP != 'configfiles' ]]; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -106,7 +106,7 @@ function restore_config {
|
||||||
if [ -d $USB_MOUNT/backup/config ]; then
|
if [ -d $USB_MOUNT/backup/config ]; then
|
||||||
echo $"Restoring configuration files"
|
echo $"Restoring configuration files"
|
||||||
temp_restore_dir=/root/tempconfig
|
temp_restore_dir=/root/tempconfig
|
||||||
restore_directory_from_usb $temp_restore_dir config
|
restore_directory_from_usb $temp_restore_dir configfiles
|
||||||
|
|
||||||
if [ -f $temp_restore_dir/root/${PROJECT_NAME}.cfg ]; then
|
if [ -f $temp_restore_dir/root/${PROJECT_NAME}.cfg ]; then
|
||||||
cp -f $temp_restore_dir/root/${PROJECT_NAME}.cfg $CONFIGURATION_FILE
|
cp -f $temp_restore_dir/root/${PROJECT_NAME}.cfg $CONFIGURATION_FILE
|
||||||
|
@ -705,7 +705,7 @@ backup_mount_drive ${1} ${ADMIN_USERNAME} ${2}
|
||||||
check_backup_exists
|
check_backup_exists
|
||||||
check_admin_user
|
check_admin_user
|
||||||
copy_gpg_keys
|
copy_gpg_keys
|
||||||
restore_config
|
restore_configfiles
|
||||||
same_admin_user
|
same_admin_user
|
||||||
restore_mariadb
|
restore_mariadb
|
||||||
restore_letsencrypt
|
restore_letsencrypt
|
||||||
|
|
|
@ -104,7 +104,7 @@ function copy_gpg_keys {
|
||||||
cp -r /home/$ADMIN_USERNAME/.gnupg /root
|
cp -r /home/$ADMIN_USERNAME/.gnupg /root
|
||||||
}
|
}
|
||||||
|
|
||||||
function restore_configuration {
|
function restore_configfiles {
|
||||||
if [[ $RESTORE_APP != 'all' ]]; then
|
if [[ $RESTORE_APP != 'all' ]]; then
|
||||||
if [[ $RESTORE_APP != 'configuration' ]]; then
|
if [[ $RESTORE_APP != 'configuration' ]]; then
|
||||||
return
|
return
|
||||||
|
@ -113,7 +113,7 @@ function restore_configuration {
|
||||||
if [ -d $SERVER_DIRECTORY/backup/config ]; then
|
if [ -d $SERVER_DIRECTORY/backup/config ]; then
|
||||||
echo $"Restoring configuration files"
|
echo $"Restoring configuration files"
|
||||||
temp_restore_dir=/root/tempconfig
|
temp_restore_dir=/root/tempconfig
|
||||||
restore_directory_from_friend $temp_restore_dir config
|
restore_directory_from_friend $temp_restore_dir configfiles
|
||||||
|
|
||||||
if [ -f $temp_restore_dir/root/${PROJECT_NAME}.cfg ]; then
|
if [ -f $temp_restore_dir/root/${PROJECT_NAME}.cfg ]; then
|
||||||
cp -f $temp_restore_dir/root/${PROJECT_NAME}.cfg $CONFIGURATION_FILE
|
cp -f $temp_restore_dir/root/${PROJECT_NAME}.cfg $CONFIGURATION_FILE
|
||||||
|
@ -642,7 +642,7 @@ function restore_email {
|
||||||
${PROJECT_NAME}-recoverkey -u ${ADMIN_USERNAME} -l $BACKUP_LIST
|
${PROJECT_NAME}-recoverkey -u ${ADMIN_USERNAME} -l $BACKUP_LIST
|
||||||
|
|
||||||
copy_gpg_keys
|
copy_gpg_keys
|
||||||
restore_configuration
|
restore_configfiles
|
||||||
restore_mariadb
|
restore_mariadb
|
||||||
restore_letsencrypt
|
restore_letsencrypt
|
||||||
restore_mutt_settings
|
restore_mutt_settings
|
||||||
|
|
Loading…
Reference in New Issue