Przeglądaj źródła

Better naming to differentiate config files from user config

Bob Mottram 8 lat temu
rodzic
commit
21717b3acd

+ 3
- 3
src/freedombone-backup-local Wyświetl plik

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

+ 3
- 3
src/freedombone-backup-remote Wyświetl plik

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

+ 6
- 6
src/freedombone-controlpanel Wyświetl plik

43
 # Minimum number of characters in a password
43
 # Minimum number of characters in a password
44
 MINIMUM_PASSWORD_LENGTH=10
44
 MINIMUM_PASSWORD_LENGTH=10
45
 if [ -f /usr/local/bin/${PROJECT_NAME} ]; then
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
 else
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
 fi
51
 fi
52
 
52
 
53
 # voip
53
 # voip
1156
         case $(cat $data) in
1156
         case $(cat $data) in
1157
             1) ${PROJECT_NAME}-restore-local $USB_DRIVE;;
1157
             1) ${PROJECT_NAME}-restore-local $USB_DRIVE;;
1158
             2) return;;
1158
             2) return;;
1159
-            3) ${PROJECT_NAME}-restore-local $USB_DRIVE configuration;;
1159
+            3) ${PROJECT_NAME}-restore-local $USB_DRIVE configfiles;;
1160
             4) ${PROJECT_NAME}-restore-local $USB_DRIVE mariadb;;
1160
             4) ${PROJECT_NAME}-restore-local $USB_DRIVE mariadb;;
1161
             5) ${PROJECT_NAME}-restore-local $USB_DRIVE letsencrypt;;
1161
             5) ${PROJECT_NAME}-restore-local $USB_DRIVE letsencrypt;;
1162
             6) ${PROJECT_NAME}-restore-local $USB_DRIVE mutt;;
1162
             6) ${PROJECT_NAME}-restore-local $USB_DRIVE mutt;;
1245
         case $(cat $data) in
1245
         case $(cat $data) in
1246
             1) ${PROJECT_NAME}-restore-remote $remote_domain_name;;
1246
             1) ${PROJECT_NAME}-restore-remote $remote_domain_name;;
1247
             2) return;;
1247
             2) return;;
1248
-            3) ${PROJECT_NAME}-restore-remote $remote_domain_name configuration;;
1248
+            3) ${PROJECT_NAME}-restore-remote $remote_domain_name configfiles;;
1249
             4) ${PROJECT_NAME}-restore-remote $remote_domain_name mariadb;;
1249
             4) ${PROJECT_NAME}-restore-remote $remote_domain_name mariadb;;
1250
             5) ${PROJECT_NAME}-restore-remote $remote_domain_name letsencrypt;;
1250
             5) ${PROJECT_NAME}-restore-remote $remote_domain_name letsencrypt;;
1251
             6) ${PROJECT_NAME}-restore-remote $remote_domain_name mutt;;
1251
             6) ${PROJECT_NAME}-restore-remote $remote_domain_name mutt;;

+ 4
- 4
src/freedombone-restore-local Wyświetl plik

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

+ 4
- 4
src/freedombone-restore-remote Wyświetl plik

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