瀏覽代碼

Better naming to differentiate config files from user config

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

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

@@ -508,7 +508,7 @@ function prepare_directories {
508 508
     fi
509 509
 }
510 510
 
511
-function backup_configuration {
511
+function backup_configfiles {
512 512
     echo $"Backing up ${PROJECT_NAME} configuration files"
513 513
     if [ ! -d /root/tempbackupconfig ]; then
514 514
         mkdir -p /root/tempbackupconfig
@@ -522,7 +522,7 @@ function backup_configuration {
522 522
     if [ -f /etc/nginx/.htpasswd ]; then
523 523
         cp -f /etc/nginx/.htpasswd /root/tempbackupconfig/htpasswd
524 524
     fi
525
-    backup_directory_to_usb /root/tempbackupconfig config
525
+    backup_directory_to_usb /root/tempbackupconfig configfiles
526 526
 }
527 527
 
528 528
 function backup_admin_readme {
@@ -639,7 +639,7 @@ update_domains
639 639
 backup_users
640 640
 prepare_directories
641 641
 backup_directories
642
-backup_configuration
642
+backup_configfiles
643 643
 backup_admin_readme
644 644
 backup_voip
645 645
 backup_mariadb

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

@@ -178,7 +178,7 @@ function backup_database_to_friend {
178 178
     fi
179 179
 }
180 180
 
181
-function backup_configuration {
181
+function backup_configfiles {
182 182
     echo $"Backing up ${PROJECT_NAME} configuration files"
183 183
     if [ ! -d /root/tempbackupconfig ]; then
184 184
         mkdir -p /root/tempbackupconfig
@@ -192,7 +192,7 @@ function backup_configuration {
192 192
     if [ -f /etc/nginx/.htpasswd ]; then
193 193
         cp -f /etc/nginx/.htpasswd /root/tempbackupconfig/htpasswd
194 194
     fi
195
-    backup_directory_to_friend /root/tempbackupconfig config
195
+    backup_directory_to_friend /root/tempbackupconfig configfiles
196 196
 }
197 197
 
198 198
 function backup_users {
@@ -653,7 +653,7 @@ if [[ "$1" == "test" ]]; then
653 653
     TEST_MODE="yes"
654 654
 fi
655 655
 
656
-backup_configuration
656
+backup_configfiles
657 657
 if [[ $TEST_MODE == "no" ]]; then
658 658
     backup_users
659 659
     backup_letsencrypt

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

@@ -43,11 +43,11 @@ UPDATE_DATE_SCRIPT=/usr/bin/updatedate
43 43
 # Minimum number of characters in a password
44 44
 MINIMUM_PASSWORD_LENGTH=10
45 45
 if [ -f /usr/local/bin/${PROJECT_NAME} ]; then
46
-	MINIMUM_PASSWORD_LENGTH=$(cat /usr/local/bin/${PROJECT_NAME} | grep 'MINIMUM_PASSWORD_LENGTH=' | head -n 1 | awk -F '=' '{print $2}')
46
+    MINIMUM_PASSWORD_LENGTH=$(cat /usr/local/bin/${PROJECT_NAME} | grep 'MINIMUM_PASSWORD_LENGTH=' | head -n 1 | awk -F '=' '{print $2}')
47 47
 else
48
-	if [ -f /usr/bin/${PROJECT_NAME} ]; then
49
-		MINIMUM_PASSWORD_LENGTH=$(cat /usr/bin/${PROJECT_NAME} | grep 'MINIMUM_PASSWORD_LENGTH=' | head -n 1 | awk -F '=' '{print $2}')
50
-	fi
48
+    if [ -f /usr/bin/${PROJECT_NAME} ]; then
49
+        MINIMUM_PASSWORD_LENGTH=$(cat /usr/bin/${PROJECT_NAME} | grep 'MINIMUM_PASSWORD_LENGTH=' | head -n 1 | awk -F '=' '{print $2}')
50
+    fi
51 51
 fi
52 52
 
53 53
 # voip
@@ -1156,7 +1156,7 @@ function restore_from_usb {
1156 1156
         case $(cat $data) in
1157 1157
             1) ${PROJECT_NAME}-restore-local $USB_DRIVE;;
1158 1158
             2) return;;
1159
-            3) ${PROJECT_NAME}-restore-local $USB_DRIVE configuration;;
1159
+            3) ${PROJECT_NAME}-restore-local $USB_DRIVE configfiles;;
1160 1160
             4) ${PROJECT_NAME}-restore-local $USB_DRIVE mariadb;;
1161 1161
             5) ${PROJECT_NAME}-restore-local $USB_DRIVE letsencrypt;;
1162 1162
             6) ${PROJECT_NAME}-restore-local $USB_DRIVE mutt;;
@@ -1245,7 +1245,7 @@ function restore_from_remote {
1245 1245
         case $(cat $data) in
1246 1246
             1) ${PROJECT_NAME}-restore-remote $remote_domain_name;;
1247 1247
             2) return;;
1248
-            3) ${PROJECT_NAME}-restore-remote $remote_domain_name configuration;;
1248
+            3) ${PROJECT_NAME}-restore-remote $remote_domain_name configfiles;;
1249 1249
             4) ${PROJECT_NAME}-restore-remote $remote_domain_name mariadb;;
1250 1250
             5) ${PROJECT_NAME}-restore-remote $remote_domain_name letsencrypt;;
1251 1251
             6) ${PROJECT_NAME}-restore-remote $remote_domain_name mutt;;

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

@@ -278,9 +278,9 @@ function update_domains {
278 278
     fi
279 279
 }
280 280
 
281
-function restore_configuration {
281
+function restore_configfiles {
282 282
     if [[ $RESTORE_APP != 'all' ]]; then
283
-        if [[ $RESTORE_APP != 'configuration' ]]; then
283
+        if [[ $RESTORE_APP != 'configfiles' ]]; then
284 284
             return
285 285
         fi
286 286
     fi
@@ -288,7 +288,7 @@ function restore_configuration {
288 288
     # this restores *.cfg and COMPLETION_FILE
289 289
     if [ -d $USB_MOUNT/backup/config ]; then
290 290
         echo $"Restoring configuration files"
291
-        restore_directory_from_usb /root/tempconfig config
291
+        restore_directory_from_usb /root/tempconfig configfiles
292 292
 
293 293
         cp -f /root/tempconfig/root/${PROJECT_NAME}.cfg $CONFIG_FILE
294 294
         if [ ! "$?" = "0" ]; then
@@ -1264,7 +1264,7 @@ mount_drive ${1} ${2}
1264 1264
 check_backup_exists
1265 1265
 check_admin_user
1266 1266
 copy_gpg_keys
1267
-restore_configuration
1267
+restore_configfiles
1268 1268
 same_admin_user
1269 1269
 update_domains
1270 1270
 restore_mariadb

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

@@ -184,15 +184,15 @@ function restore_database_from_friend {
184 184
     fi
185 185
 }
186 186
 
187
-function restore_configuration {
187
+function restore_configfiles {
188 188
     if [[ $RESTORE_APP != 'all' ]]; then
189
-        if [[ $RESTORE_APP != 'configuration' ]]; then
189
+        if [[ $RESTORE_APP != 'configfiles' ]]; then
190 190
             return
191 191
         fi
192 192
     fi
193 193
     if [ -d $SERVER_DIRECTORY/backup/config ]; then
194 194
         echo $"Restoring configuration files"
195
-        restore_directory_from_friend /root/tempconfig config
195
+        restore_directory_from_friend /root/tempconfig configfiles
196 196
 
197 197
         cp -f /root/tempconfig/root/${PROJECT_NAME}.cfg $CONFIG_FILE
198 198
         if [ ! "$?" = "0" ]; then
@@ -1107,7 +1107,7 @@ function restore_dlna {
1107 1107
 ${PROJECT_NAME}-recoverkey -u ${ADMIN_USERNAME} -l $BACKUP_LIST
1108 1108
 
1109 1109
 copy_gpg_keys
1110
-restore_configuration
1110
+restore_configfiles
1111 1111
 restore_mariadb
1112 1112
 restore_letsencrypt
1113 1113
 restore_mutt_settings