Better naming to differentiate config files from user config
This commit is contained in:
parent
d79ad89c16
commit
21717b3acd
@ -508,7 +508,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"
|
||||||
if [ ! -d /root/tempbackupconfig ]; then
|
if [ ! -d /root/tempbackupconfig ]; then
|
||||||
mkdir -p /root/tempbackupconfig
|
mkdir -p /root/tempbackupconfig
|
||||||
@ -522,7 +522,7 @@ function backup_configuration {
|
|||||||
if [ -f /etc/nginx/.htpasswd ]; then
|
if [ -f /etc/nginx/.htpasswd ]; then
|
||||||
cp -f /etc/nginx/.htpasswd /root/tempbackupconfig/htpasswd
|
cp -f /etc/nginx/.htpasswd /root/tempbackupconfig/htpasswd
|
||||||
fi
|
fi
|
||||||
backup_directory_to_usb /root/tempbackupconfig config
|
backup_directory_to_usb /root/tempbackupconfig configfiles
|
||||||
}
|
}
|
||||||
|
|
||||||
function backup_admin_readme {
|
function backup_admin_readme {
|
||||||
@ -639,7 +639,7 @@ update_domains
|
|||||||
backup_users
|
backup_users
|
||||||
prepare_directories
|
prepare_directories
|
||||||
backup_directories
|
backup_directories
|
||||||
backup_configuration
|
backup_configfiles
|
||||||
backup_admin_readme
|
backup_admin_readme
|
||||||
backup_voip
|
backup_voip
|
||||||
backup_mariadb
|
backup_mariadb
|
||||||
|
@ -178,7 +178,7 @@ function backup_database_to_friend {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function backup_configuration {
|
function backup_configfiles {
|
||||||
echo $"Backing up ${PROJECT_NAME} configuration files"
|
echo $"Backing up ${PROJECT_NAME} configuration files"
|
||||||
if [ ! -d /root/tempbackupconfig ]; then
|
if [ ! -d /root/tempbackupconfig ]; then
|
||||||
mkdir -p /root/tempbackupconfig
|
mkdir -p /root/tempbackupconfig
|
||||||
@ -192,7 +192,7 @@ function backup_configuration {
|
|||||||
if [ -f /etc/nginx/.htpasswd ]; then
|
if [ -f /etc/nginx/.htpasswd ]; then
|
||||||
cp -f /etc/nginx/.htpasswd /root/tempbackupconfig/htpasswd
|
cp -f /etc/nginx/.htpasswd /root/tempbackupconfig/htpasswd
|
||||||
fi
|
fi
|
||||||
backup_directory_to_friend /root/tempbackupconfig config
|
backup_directory_to_friend /root/tempbackupconfig configfiles
|
||||||
}
|
}
|
||||||
|
|
||||||
function backup_users {
|
function backup_users {
|
||||||
@ -653,7 +653,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
|
||||||
|
@ -43,11 +43,11 @@ UPDATE_DATE_SCRIPT=/usr/bin/updatedate
|
|||||||
# Minimum number of characters in a password
|
# Minimum number of characters in a password
|
||||||
MINIMUM_PASSWORD_LENGTH=10
|
MINIMUM_PASSWORD_LENGTH=10
|
||||||
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then
|
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then
|
||||||
MINIMUM_PASSWORD_LENGTH=$(cat /usr/local/bin/${PROJECT_NAME} | grep 'MINIMUM_PASSWORD_LENGTH=' | head -n 1 | awk -F '=' '{print $2}')
|
MINIMUM_PASSWORD_LENGTH=$(cat /usr/local/bin/${PROJECT_NAME} | grep 'MINIMUM_PASSWORD_LENGTH=' | head -n 1 | awk -F '=' '{print $2}')
|
||||||
else
|
else
|
||||||
if [ -f /usr/bin/${PROJECT_NAME} ]; then
|
if [ -f /usr/bin/${PROJECT_NAME} ]; then
|
||||||
MINIMUM_PASSWORD_LENGTH=$(cat /usr/bin/${PROJECT_NAME} | grep 'MINIMUM_PASSWORD_LENGTH=' | head -n 1 | awk -F '=' '{print $2}')
|
MINIMUM_PASSWORD_LENGTH=$(cat /usr/bin/${PROJECT_NAME} | grep 'MINIMUM_PASSWORD_LENGTH=' | head -n 1 | awk -F '=' '{print $2}')
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# voip
|
# voip
|
||||||
@ -1156,7 +1156,7 @@ function restore_from_usb {
|
|||||||
case $(cat $data) in
|
case $(cat $data) in
|
||||||
1) ${PROJECT_NAME}-restore-local $USB_DRIVE;;
|
1) ${PROJECT_NAME}-restore-local $USB_DRIVE;;
|
||||||
2) return;;
|
2) return;;
|
||||||
3) ${PROJECT_NAME}-restore-local $USB_DRIVE configuration;;
|
3) ${PROJECT_NAME}-restore-local $USB_DRIVE configfiles;;
|
||||||
4) ${PROJECT_NAME}-restore-local $USB_DRIVE mariadb;;
|
4) ${PROJECT_NAME}-restore-local $USB_DRIVE mariadb;;
|
||||||
5) ${PROJECT_NAME}-restore-local $USB_DRIVE letsencrypt;;
|
5) ${PROJECT_NAME}-restore-local $USB_DRIVE letsencrypt;;
|
||||||
6) ${PROJECT_NAME}-restore-local $USB_DRIVE mutt;;
|
6) ${PROJECT_NAME}-restore-local $USB_DRIVE mutt;;
|
||||||
@ -1245,7 +1245,7 @@ function restore_from_remote {
|
|||||||
case $(cat $data) in
|
case $(cat $data) in
|
||||||
1) ${PROJECT_NAME}-restore-remote $remote_domain_name;;
|
1) ${PROJECT_NAME}-restore-remote $remote_domain_name;;
|
||||||
2) return;;
|
2) return;;
|
||||||
3) ${PROJECT_NAME}-restore-remote $remote_domain_name configuration;;
|
3) ${PROJECT_NAME}-restore-remote $remote_domain_name configfiles;;
|
||||||
4) ${PROJECT_NAME}-restore-remote $remote_domain_name mariadb;;
|
4) ${PROJECT_NAME}-restore-remote $remote_domain_name mariadb;;
|
||||||
5) ${PROJECT_NAME}-restore-remote $remote_domain_name letsencrypt;;
|
5) ${PROJECT_NAME}-restore-remote $remote_domain_name letsencrypt;;
|
||||||
6) ${PROJECT_NAME}-restore-remote $remote_domain_name mutt;;
|
6) ${PROJECT_NAME}-restore-remote $remote_domain_name mutt;;
|
||||||
|
@ -278,9 +278,9 @@ function update_domains {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function restore_configuration {
|
function restore_configfiles {
|
||||||
if [[ $RESTORE_APP != 'all' ]]; then
|
if [[ $RESTORE_APP != 'all' ]]; then
|
||||||
if [[ $RESTORE_APP != 'configuration' ]]; then
|
if [[ $RESTORE_APP != 'configfiles' ]]; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@ -288,7 +288,7 @@ function restore_configuration {
|
|||||||
# this restores *.cfg and COMPLETION_FILE
|
# this restores *.cfg and COMPLETION_FILE
|
||||||
if [ -d $USB_MOUNT/backup/config ]; then
|
if [ -d $USB_MOUNT/backup/config ]; then
|
||||||
echo $"Restoring configuration files"
|
echo $"Restoring configuration files"
|
||||||
restore_directory_from_usb /root/tempconfig config
|
restore_directory_from_usb /root/tempconfig configfiles
|
||||||
|
|
||||||
cp -f /root/tempconfig/root/${PROJECT_NAME}.cfg $CONFIG_FILE
|
cp -f /root/tempconfig/root/${PROJECT_NAME}.cfg $CONFIG_FILE
|
||||||
if [ ! "$?" = "0" ]; then
|
if [ ! "$?" = "0" ]; then
|
||||||
@ -1264,7 +1264,7 @@ mount_drive ${1} ${2}
|
|||||||
check_backup_exists
|
check_backup_exists
|
||||||
check_admin_user
|
check_admin_user
|
||||||
copy_gpg_keys
|
copy_gpg_keys
|
||||||
restore_configuration
|
restore_configfiles
|
||||||
same_admin_user
|
same_admin_user
|
||||||
update_domains
|
update_domains
|
||||||
restore_mariadb
|
restore_mariadb
|
||||||
|
@ -184,15 +184,15 @@ function restore_database_from_friend {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function restore_configuration {
|
function restore_configfiles {
|
||||||
if [[ $RESTORE_APP != 'all' ]]; then
|
if [[ $RESTORE_APP != 'all' ]]; then
|
||||||
if [[ $RESTORE_APP != 'configuration' ]]; then
|
if [[ $RESTORE_APP != 'configfiles' ]]; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [ -d $SERVER_DIRECTORY/backup/config ]; then
|
if [ -d $SERVER_DIRECTORY/backup/config ]; then
|
||||||
echo $"Restoring configuration files"
|
echo $"Restoring configuration files"
|
||||||
restore_directory_from_friend /root/tempconfig config
|
restore_directory_from_friend /root/tempconfig configfiles
|
||||||
|
|
||||||
cp -f /root/tempconfig/root/${PROJECT_NAME}.cfg $CONFIG_FILE
|
cp -f /root/tempconfig/root/${PROJECT_NAME}.cfg $CONFIG_FILE
|
||||||
if [ ! "$?" = "0" ]; then
|
if [ ! "$?" = "0" ]; then
|
||||||
@ -1107,7 +1107,7 @@ function restore_dlna {
|
|||||||
${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…
x
Reference in New Issue
Block a user