Move resetting of the tripwire to the control panel

Since it's a commonly used function
This commit is contained in:
Bob Mottram 2015-11-03 09:34:28 +00:00
parent f6f2bc51a5
commit 5896c10a1a
2 changed files with 14 additions and 21 deletions

View File

@ -450,6 +450,14 @@ function security_settings {
any_key any_key
} }
function reset_tripwire {
clear
echo '
' | reset-tripwire
any_key
}
function menu_backup_restore { function menu_backup_restore {
while true while true
do do
@ -545,14 +553,15 @@ function menu_top_level {
trap "rm -f $data" 0 1 2 5 15 trap "rm -f $data" 0 1 2 5 15
dialog --backtitle "Freedombone Control Panel" \ dialog --backtitle "Freedombone Control Panel" \
--title "Control Panel" \ --title "Control Panel" \
--radiolist "Choose an operation:" 14 70 7 \ --radiolist "Choose an operation:" 15 70 8 \
1 "Backup and Restore" off \ 1 "Backup and Restore" off \
2 "Show SIP Phone Extensions" off \ 2 "Show SIP Phone Extensions" off \
3 "Logging on/off" off \ 3 "Logging on/off" off \
4 "Manage Users" off \ 4 "Manage Users" off \
5 "Email Filtering Rules" off \ 5 "Email Filtering Rules" off \
6 "Security Settings" off \ 6 "Security Settings" off \
7 "Exit" on 2> $data 7 "Reset Tripwire" off \
8 "Exit" on 2> $data
sel=$? sel=$?
case $sel in case $sel in
1) exit 1;; 1) exit 1;;
@ -565,7 +574,8 @@ function menu_top_level {
4) menu_users;; 4) menu_users;;
5) menu_email;; 5) menu_email;;
6) security_settings;; 6) security_settings;;
7) break;; 7) reset_tripwire;;
8) break;;
esac esac
done done
} }

View File

@ -52,7 +52,6 @@ CURRENT_DIR=$(pwd)
REGENERATE_SSH_HOST_KEYS="no" REGENERATE_SSH_HOST_KEYS="no"
REGENERATE_DH_KEYS="no" REGENERATE_DH_KEYS="no"
RESET_TRIPWIRE="no"
DH_KEYLENGTH=2048 DH_KEYLENGTH=2048
function get_protocols_from_website { function get_protocols_from_website {
@ -376,25 +375,13 @@ function regenerate_dh_keys {
fi fi
} }
function reset_tripwire {
if [[ $RESET_TRIPWIRE != "yes" ]]; then
return
fi
clear
echo '
' | reset-tripwire
exit 0
}
function housekeeping { function housekeeping {
cmd=(dialog --separate-output \ cmd=(dialog --separate-output \
--backtitle "Freedombone Security Configuration" \ --backtitle "Freedombone Security Configuration" \
--title "Housekeeping options" \ --title "Housekeeping options" \
--checklist "If you don't need to do any of these things then just press Enter:" 10 76 16) --checklist "If you don't need to do any of these things then just press Enter:" 10 76 16)
options=(1 "Regenerate ssh host keys" off options=(1 "Regenerate ssh host keys" off
2 "Regenerate Diffie-Hellman keys" off 2 "Regenerate Diffie-Hellman keys" off)
3 "Reset tripwire" off)
choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty) choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)
clear clear
for choice in $choices for choice in $choices
@ -406,12 +393,8 @@ function housekeeping {
2) 2)
REGENERATE_DH_KEYS="yes" REGENERATE_DH_KEYS="yes"
;; ;;
3)
RESET_TRIPWIRE="yes"
;;
esac esac
done done
reset_tripwire
} }
function import_settings { function import_settings {