Use project name

This commit is contained in:
Bob Mottram 2018-01-20 18:25:29 +00:00
parent 22198a7f5f
commit ff55d42e29
1 changed files with 8 additions and 8 deletions

View File

@ -154,7 +154,7 @@ function any_key_verify {
dialog --title $"Check tripwire" \ dialog --title $"Check tripwire" \
--msgbox $"\nThe hash should not contain any spaces" 10 40 --msgbox $"\nThe hash should not contain any spaces" 10 40
else else
DBHASH=$(sha512sum /var/lib/tripwire/${HOSTNAME}.twd | awk -F ' ' '{print $1}') DBHASH=$(sha512sum /var/lib/tripwire/${PROJECT_NAME}.twd | awk -F ' ' '{print $1}')
if [[ "$DBHASH" == "$GIVEN_HASH" ]]; then if [[ "$DBHASH" == "$GIVEN_HASH" ]]; then
dialog --title $"Check tripwire" \ dialog --title $"Check tripwire" \
--msgbox $"\nSuccess\n\nThe hash you gave matches the current tripwire database" 10 40 --msgbox $"\nSuccess\n\nThe hash you gave matches the current tripwire database" 10 40
@ -1305,14 +1305,14 @@ function security_settings {
} }
function show_tripwire_verification_code { function show_tripwire_verification_code {
if [ ! -f /var/lib/tripwire/${HOSTNAME}.twd ]; then if [ ! -f /var/lib/tripwire/${PROJECT_NAME}.twd ]; then
return return
fi fi
clear clear
echo '' echo ''
echo $'Tripwire Verification Code' echo $'Tripwire Verification Code'
echo '' echo ''
DBHASH=$(sha512sum /var/lib/tripwire/${HOSTNAME}.twd) DBHASH=$(sha512sum /var/lib/tripwire/${PROJECT_NAME}.twd)
echo -n "$DBHASH" | qrencode -t UTF8 echo -n "$DBHASH" | qrencode -t UTF8
echo '' echo ''
echo "$DBHASH" echo "$DBHASH"
@ -1325,7 +1325,7 @@ function reset_tripwire {
any_key any_key
return return
fi fi
if [ ! -f /etc/tripwire/${HOSTNAME}-local.key ]; then if [ ! -f /etc/tripwire/${PROJECT_NAME}-local.key ]; then
echo $'Error: missing local key' echo $'Error: missing local key'
any_key any_key
return return
@ -1338,15 +1338,15 @@ function reset_tripwire {
echo $'Creating configuration...' echo $'Creating configuration...'
echo ' echo '
' | twadmin --create-cfgfile -S /etc/tripwire/${HOSTNAME}-site.key /etc/tripwire/twcfg.txt ' | twadmin --create-cfgfile -S /etc/tripwire/${PROJECT_NAME}-site.key /etc/tripwire/twcfg.txt
echo $'Resetting policy...' echo $'Resetting policy...'
echo ' echo '
' | twadmin --create-polfile -S /etc/tripwire/${HOSTNAME}-site.key /etc/tripwire/twpol.txt ' | twadmin --create-polfile -S /etc/tripwire/${PROJECT_NAME}-site.key /etc/tripwire/twpol.txt
echo $'Creating tripwire database' echo $'Creating tripwire database'
echo ' echo '
' | tripwire --init --cfgfile /etc/tripwire/tw.cfg --polfile /etc/tripwire/tw.pol --dbfile /var/lib/tripwire/${HOSTNAME}.twd ' | tripwire --init --cfgfile /etc/tripwire/tw.cfg --polfile /etc/tripwire/tw.pol --dbfile /var/lib/tripwire/${PROJECT_NAME}.twd
echo $'Resetting the Tripwire...' echo $'Resetting the Tripwire...'
echo '' echo ''
echo ' echo '
@ -1361,7 +1361,7 @@ function reset_tripwire {
systemctl restart nginx systemctl restart nginx
fi fi
if [ -f /var/lib/tripwire/${HOSTNAME}.twd ]; then if [ -f /var/lib/tripwire/${PROJECT_NAME}.twd ]; then
show_tripwire_verification_code show_tripwire_verification_code
echo $'Tripwire is now reset. Take a note of the above hash, or record' 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 $'the QR code using a mobile device. This will enable you to independently'