Browse Source

Move resetting of the tripwire to the control panel

Since it's a commonly used function
Bob Mottram 9 years ago
parent
commit
5896c10a1a
2 changed files with 14 additions and 21 deletions
  1. 13
    3
      src/freedombone-controlpanel
  2. 1
    18
      src/freedombone-sec

+ 13
- 3
src/freedombone-controlpanel View File

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

+ 1
- 18
src/freedombone-sec View File

52
 
52
 
53
 REGENERATE_SSH_HOST_KEYS="no"
53
 REGENERATE_SSH_HOST_KEYS="no"
54
 REGENERATE_DH_KEYS="no"
54
 REGENERATE_DH_KEYS="no"
55
-RESET_TRIPWIRE="no"
56
 DH_KEYLENGTH=2048
55
 DH_KEYLENGTH=2048
57
 
56
 
58
 function get_protocols_from_website {
57
 function get_protocols_from_website {
376
   fi
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
 function housekeeping {
378
 function housekeeping {
391
   cmd=(dialog --separate-output \
379
   cmd=(dialog --separate-output \
392
               --backtitle "Freedombone Security Configuration" \
380
               --backtitle "Freedombone Security Configuration" \
393
               --title "Housekeeping options" \
381
               --title "Housekeeping options" \
394
               --checklist "If you don't need to do any of these things then just press Enter:" 10 76 16)
382
               --checklist "If you don't need to do any of these things then just press Enter:" 10 76 16)
395
   options=(1 "Regenerate ssh host keys" off
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
   choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)
385
   choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)
399
   clear
386
   clear
400
   for choice in $choices
387
   for choice in $choices
406
       2)
393
       2)
407
         REGENERATE_DH_KEYS="yes"
394
         REGENERATE_DH_KEYS="yes"
408
         ;;
395
         ;;
409
-      3)
410
-        RESET_TRIPWIRE="yes"
411
-        ;;
412
     esac
396
     esac
413
   done
397
   done
414
-  reset_tripwire
415
 }
398
 }
416
 
399
 
417
 function import_settings {
400
 function import_settings {