Преглед изворни кода

Move resetting of the tripwire to the control panel

Since it's a commonly used function
Bob Mottram пре 9 година
родитељ
комит
5896c10a1a
2 измењених фајлова са 14 додато и 21 уклоњено
  1. 13
    3
      src/freedombone-controlpanel
  2. 1
    18
      src/freedombone-sec

+ 13
- 3
src/freedombone-controlpanel Прегледај датотеку

@@ -450,6 +450,14 @@ function security_settings {
450 450
     any_key
451 451
 }
452 452
 
453
+function reset_tripwire {
454
+  clear
455
+  echo '
456
+
457
+' | reset-tripwire
458
+  any_key
459
+}
460
+
453 461
 function menu_backup_restore {
454 462
     while true
455 463
     do
@@ -545,14 +553,15 @@ function menu_top_level {
545 553
         trap "rm -f $data" 0 1 2 5 15
546 554
         dialog --backtitle "Freedombone Control Panel" \
547 555
                --title "Control Panel" \
548
-               --radiolist "Choose an operation:" 14 70 7 \
556
+               --radiolist "Choose an operation:" 15 70 8 \
549 557
                1 "Backup and Restore" off \
550 558
                2 "Show SIP Phone Extensions" off \
551 559
                3 "Logging on/off" off \
552 560
                4 "Manage Users" off \
553 561
                5 "Email Filtering Rules" off \
554 562
                6 "Security Settings" off \
555
-               7 "Exit" on 2> $data
563
+               7 "Reset Tripwire" off \
564
+               8 "Exit" on 2> $data
556 565
         sel=$?
557 566
         case $sel in
558 567
             1) exit 1;;
@@ -565,7 +574,8 @@ function menu_top_level {
565 574
             4) menu_users;;
566 575
             5) menu_email;;
567 576
             6) security_settings;;
568
-            7) break;;
577
+            7) reset_tripwire;;
578
+            8) break;;
569 579
         esac
570 580
     done
571 581
 }

+ 1
- 18
src/freedombone-sec Прегледај датотеку

@@ -52,7 +52,6 @@ CURRENT_DIR=$(pwd)
52 52
 
53 53
 REGENERATE_SSH_HOST_KEYS="no"
54 54
 REGENERATE_DH_KEYS="no"
55
-RESET_TRIPWIRE="no"
56 55
 DH_KEYLENGTH=2048
57 56
 
58 57
 function get_protocols_from_website {
@@ -376,25 +375,13 @@ function regenerate_dh_keys {
376 375
   fi
377 376
 }
378 377
 
379
-function reset_tripwire {
380
-  if [[ $RESET_TRIPWIRE != "yes" ]]; then
381
-      return
382
-  fi
383
-  clear
384
-  echo '
385
-
386
-' | reset-tripwire
387
-  exit 0
388
-}
389
-
390 378
 function housekeeping {
391 379
   cmd=(dialog --separate-output \
392 380
               --backtitle "Freedombone Security Configuration" \
393 381
               --title "Housekeeping options" \
394 382
               --checklist "If you don't need to do any of these things then just press Enter:" 10 76 16)
395 383
   options=(1 "Regenerate ssh host keys" off
396
-           2 "Regenerate Diffie-Hellman keys" off
397
-           3 "Reset tripwire" off)
384
+           2 "Regenerate Diffie-Hellman keys" off)
398 385
   choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)
399 386
   clear
400 387
   for choice in $choices
@@ -406,12 +393,8 @@ function housekeeping {
406 393
       2)
407 394
         REGENERATE_DH_KEYS="yes"
408 395
         ;;
409
-      3)
410
-        RESET_TRIPWIRE="yes"
411
-        ;;
412 396
     esac
413 397
   done
414
-  reset_tripwire
415 398
 }
416 399
 
417 400
 function import_settings {