Option to verify the tripwire code

This commit is contained in:
Bob Mottram 2017-08-05 13:30:58 +01:00
parent 99479d6448
commit d9adff3a9e
1 changed files with 52 additions and 39 deletions

View File

@ -1268,6 +1268,18 @@ function security_settings {
any_key
}
function show_tripwire_verification_code {
clear
echo ''
echo $'Tripwire Verification Code'
echo ''
DBHASH=$(sha512sum /var/lib/tripwire/${HOSTNAME}.twd)
echo "$DBHASH" | qrencode -t UTF8
echo ''
echo "$DBHASH"
echo ''
}
function reset_tripwire {
if [ ! -f /usr/bin/reset-tripwire ]; then
echo $'Missing /usr/bin/reset-tripwire'
@ -1299,12 +1311,10 @@ function reset_tripwire {
' | reset-tripwire
echo ''
if [ -f /var/lib/tripwire/${HOSTNAME}.twd ]; then
DBHASH=$(sha512sum /var/lib/tripwire/${HOSTNAME}.twd)
echo "$DBHASH" | qrencode -t UTF8
echo ''
echo "$DBHASH"
echo ''
echo $'Tripwire is now reset'
show_tripwire_verification_code
echo $'Tripwire is now reset. Take a note of the above hash, or record'
echo $'the QR code using a mobile device. This will enable you to independently'
echo $'verify the integrity of the tripwire.'
else
echo $'ERROR: tripwire database was not created'
fi
@ -2131,27 +2141,28 @@ function menu_top_level {
trap "rm -f $data" 0 1 2 5 15
dialog --backtitle $"Freedombone Control Panel" \
--title $"Control Panel" \
--radiolist $"Choose an operation:" 28 70 20 \
--radiolist $"Choose an operation:" 29 70 21 \
1 $"About this system" off \
2 $"Passwords" off \
3 $"Backup and Restore" off \
4 $"Show Firewall" off \
5 $"Reset Tripwire" off \
6 $"App Settings" off \
7 $"Add/Remove Apps" off \
8 $"Logging on/off" off \
9 $"Ping enable/disable" off \
10 $"Manage Users" off \
11 $"Email Menu" off \
12 $"Domain or User Blocking" off \
13 $"Security Settings" off \
14 $"Change the name of this system" off \
15 $"Set a static local IP address" off \
16 $"Wifi menu" off \
17 $"Check for updates" off \
18 $"Power off the system" off \
19 $"Restart the system" off \
20 $"Exit" on 2> $data
5 $"Verify Tripwire Code" off \
6 $"Reset Tripwire" off \
7 $"App Settings" off \
8 $"Add/Remove Apps" off \
9 $"Logging on/off" off \
10 $"Ping enable/disable" off \
11 $"Manage Users" off \
12 $"Email Menu" off \
13 $"Domain or User Blocking" off \
14 $"Security Settings" off \
15 $"Change the name of this system" off \
16 $"Set a static local IP address" off \
17 $"Wifi menu" off \
18 $"Check for updates" off \
19 $"Power off the system" off \
20 $"Restart the system" off \
21 $"Exit" on 2> $data
sel=$?
case $sel in
1) exit 1;;
@ -2163,26 +2174,28 @@ function menu_top_level {
2) view_or_change_passwords;;
3) menu_backup_restore;;
4) show_firewall;;
5) reset_tripwire;;
6) menu_app_settings;;
7) /usr/local/bin/addremove
5) show_tripwire_verification_code
any_key;;
6) reset_tripwire;;
7) menu_app_settings;;
8) /usr/local/bin/addremove
if [ ! "$?" = "0" ]; then
any_key
fi
;;
8) logging_on_off;;
9) ping_enable_disable;;
10) menu_users;;
11) menu_email;;
12) domain_blocking;;
13) security_settings;;
14) change_system_name;;
15) set_static_IP;;
16) menu_wifi;;
17) check_for_updates;;
18) shut_down_system;;
19) restart_system;;
20) break;;
9) logging_on_off;;
10) ping_enable_disable;;
11) menu_users;;
12) menu_email;;
13) domain_blocking;;
14) security_settings;;
15) change_system_name;;
16) set_static_IP;;
17) menu_wifi;;
18) check_for_updates;;
19) shut_down_system;;
20) restart_system;;
21) break;;
esac
done
}