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" \
--msgbox $"\nThe hash should not contain any spaces" 10 40
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
dialog --title $"Check tripwire" \
--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 {
if [ ! -f /var/lib/tripwire/${HOSTNAME}.twd ]; then
if [ ! -f /var/lib/tripwire/${PROJECT_NAME}.twd ]; then
return
fi
clear
echo ''
echo $'Tripwire Verification Code'
echo ''
DBHASH=$(sha512sum /var/lib/tripwire/${HOSTNAME}.twd)
DBHASH=$(sha512sum /var/lib/tripwire/${PROJECT_NAME}.twd)
echo -n "$DBHASH" | qrencode -t UTF8
echo ''
echo "$DBHASH"
@ -1325,7 +1325,7 @@ function reset_tripwire {
any_key
return
fi
if [ ! -f /etc/tripwire/${HOSTNAME}-local.key ]; then
if [ ! -f /etc/tripwire/${PROJECT_NAME}-local.key ]; then
echo $'Error: missing local key'
any_key
return
@ -1338,15 +1338,15 @@ function reset_tripwire {
echo $'Creating configuration...'
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 '
' | 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 '
' | 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 ''
echo '
@ -1361,7 +1361,7 @@ function reset_tripwire {
systemctl restart nginx
fi
if [ -f /var/lib/tripwire/${HOSTNAME}.twd ]; then
if [ -f /var/lib/tripwire/${PROJECT_NAME}.twd ]; then
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'