瀏覽代碼

Better naming to differentiate config files from user config

Bob Mottram 8 年之前
父節點
當前提交
a912e6cfc3

+ 3
- 3
src/freedombone-backup-local 查看文件

243
     fi
243
     fi
244
 }
244
 }
245
 
245
 
246
-function backup_configuration {
246
+function backup_configfiles {
247
     echo $"Backing up ${PROJECT_NAME} configuration files"
247
     echo $"Backing up ${PROJECT_NAME} configuration files"
248
     temp_backup_dir=/root/tempbackupconfig
248
     temp_backup_dir=/root/tempbackupconfig
249
     if [ ! -d $temp_backup_dir ]; then
249
     if [ ! -d $temp_backup_dir ]; then
258
     if [ -f /etc/nginx/.htpasswd ]; then
258
     if [ -f /etc/nginx/.htpasswd ]; then
259
         cp -f /etc/nginx/.htpasswd $temp_backup_dir/htpasswd
259
         cp -f /etc/nginx/.htpasswd $temp_backup_dir/htpasswd
260
     fi
260
     fi
261
-    backup_directory_to_usb $temp_backup_dir config
261
+    backup_directory_to_usb $temp_backup_dir configfiles
262
 }
262
 }
263
 
263
 
264
 function backup_admin_readme {
264
 function backup_admin_readme {
307
 prepare_directories
307
 prepare_directories
308
 backup_directories
308
 backup_directories
309
 backup_apps local
309
 backup_apps local
310
-backup_configuration
310
+backup_configfiles
311
 backup_admin_readme
311
 backup_admin_readme
312
 backup_mariadb
312
 backup_mariadb
313
 backup_extra_directories local
313
 backup_extra_directories local

+ 3
- 3
src/freedombone-backup-remote 查看文件

108
     SUSPENDED_SITE=
108
     SUSPENDED_SITE=
109
 }
109
 }
110
 
110
 
111
-function backup_configuration {
111
+function backup_configfiles {
112
     echo $"Backing up ${PROJECT_NAME} configuration files"
112
     echo $"Backing up ${PROJECT_NAME} configuration files"
113
     temp_backup_dir=/root/tempbackupconfig
113
     temp_backup_dir=/root/tempbackupconfig
114
     if [ ! -d $temp_backup_dir ]; then
114
     if [ ! -d $temp_backup_dir ]; then
123
     if [ -f /etc/nginx/.htpasswd ]; then
123
     if [ -f /etc/nginx/.htpasswd ]; then
124
         cp -f /etc/nginx/.htpasswd $temp_backup_dir/htpasswd
124
         cp -f /etc/nginx/.htpasswd $temp_backup_dir/htpasswd
125
     fi
125
     fi
126
-    backup_directory_to_friend $temp_backup_dir config
126
+    backup_directory_to_friend $temp_backup_dir configfiles
127
 }
127
 }
128
 
128
 
129
 function backup_users {
129
 function backup_users {
369
     TEST_MODE="yes"
369
     TEST_MODE="yes"
370
 fi
370
 fi
371
 
371
 
372
-backup_configuration
372
+backup_configfiles
373
 if [[ $TEST_MODE == "no" ]]; then
373
 if [[ $TEST_MODE == "no" ]]; then
374
     backup_users
374
     backup_users
375
     backup_letsencrypt
375
     backup_letsencrypt

+ 1
- 1
src/freedombone-controlpanel 查看文件

892
         restore_command="${PROJECT_NAME}-restore-local $USB_DRIVE"
892
         restore_command="${PROJECT_NAME}-restore-local $USB_DRIVE"
893
     fi
893
     fi
894
 
894
 
895
-    utils_installed=(config
895
+    utils_installed=(configfiles
896
                      mariadb
896
                      mariadb
897
                      letsencrypt
897
                      letsencrypt
898
                      mutt
898
                      mutt

+ 4
- 4
src/freedombone-restore-local 查看文件

95
     cp -r /home/$ADMIN_USERNAME/.gnupg /root
95
     cp -r /home/$ADMIN_USERNAME/.gnupg /root
96
 }
96
 }
97
 
97
 
98
-function restore_config {
98
+function restore_configfiles {
99
     if [[ $RESTORE_APP != 'all' ]]; then
99
     if [[ $RESTORE_APP != 'all' ]]; then
100
-        if [[ $RESTORE_APP != 'config' ]]; then
100
+        if [[ $RESTORE_APP != 'configfiles' ]]; then
101
             return
101
             return
102
         fi
102
         fi
103
     fi
103
     fi
106
     if [ -d $USB_MOUNT/backup/config ]; then
106
     if [ -d $USB_MOUNT/backup/config ]; then
107
         echo $"Restoring configuration files"
107
         echo $"Restoring configuration files"
108
         temp_restore_dir=/root/tempconfig
108
         temp_restore_dir=/root/tempconfig
109
-        restore_directory_from_usb $temp_restore_dir config
109
+        restore_directory_from_usb $temp_restore_dir configfiles
110
 
110
 
111
         if [ -f $temp_restore_dir/root/${PROJECT_NAME}.cfg ]; then
111
         if [ -f $temp_restore_dir/root/${PROJECT_NAME}.cfg ]; then
112
             cp -f $temp_restore_dir/root/${PROJECT_NAME}.cfg $CONFIGURATION_FILE
112
             cp -f $temp_restore_dir/root/${PROJECT_NAME}.cfg $CONFIGURATION_FILE
705
 check_backup_exists
705
 check_backup_exists
706
 check_admin_user
706
 check_admin_user
707
 copy_gpg_keys
707
 copy_gpg_keys
708
-restore_config
708
+restore_configfiles
709
 same_admin_user
709
 same_admin_user
710
 restore_mariadb
710
 restore_mariadb
711
 restore_letsencrypt
711
 restore_letsencrypt

+ 3
- 3
src/freedombone-restore-remote 查看文件

104
     cp -r /home/$ADMIN_USERNAME/.gnupg /root
104
     cp -r /home/$ADMIN_USERNAME/.gnupg /root
105
 }
105
 }
106
 
106
 
107
-function restore_configuration {
107
+function restore_configfiles {
108
     if [[ $RESTORE_APP != 'all' ]]; then
108
     if [[ $RESTORE_APP != 'all' ]]; then
109
         if [[ $RESTORE_APP != 'configuration' ]]; then
109
         if [[ $RESTORE_APP != 'configuration' ]]; then
110
             return
110
             return
113
     if [ -d $SERVER_DIRECTORY/backup/config ]; then
113
     if [ -d $SERVER_DIRECTORY/backup/config ]; then
114
         echo $"Restoring configuration files"
114
         echo $"Restoring configuration files"
115
         temp_restore_dir=/root/tempconfig
115
         temp_restore_dir=/root/tempconfig
116
-        restore_directory_from_friend $temp_restore_dir config
116
+        restore_directory_from_friend $temp_restore_dir configfiles
117
 
117
 
118
         if [ -f $temp_restore_dir/root/${PROJECT_NAME}.cfg ]; then
118
         if [ -f $temp_restore_dir/root/${PROJECT_NAME}.cfg ]; then
119
             cp -f $temp_restore_dir/root/${PROJECT_NAME}.cfg $CONFIGURATION_FILE
119
             cp -f $temp_restore_dir/root/${PROJECT_NAME}.cfg $CONFIGURATION_FILE
642
 ${PROJECT_NAME}-recoverkey -u ${ADMIN_USERNAME} -l $BACKUP_LIST
642
 ${PROJECT_NAME}-recoverkey -u ${ADMIN_USERNAME} -l $BACKUP_LIST
643
 
643
 
644
 copy_gpg_keys
644
 copy_gpg_keys
645
-restore_configuration
645
+restore_configfiles
646
 restore_mariadb
646
 restore_mariadb
647
 restore_letsencrypt
647
 restore_letsencrypt
648
 restore_mutt_settings
648
 restore_mutt_settings