From 61aef304fef960eca419c712f7c819e5193c44cf Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 20 Jan 2018 18:34:09 +0000 Subject: [PATCH] Convert tripwire key filenames --- src/freedombone-controlpanel | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/freedombone-controlpanel b/src/freedombone-controlpanel index 66e6c343..956969ff 100755 --- a/src/freedombone-controlpanel +++ b/src/freedombone-controlpanel @@ -1325,10 +1325,15 @@ function reset_tripwire { any_key return fi - if [ ! -f /etc/tripwire/${PROJECT_NAME}-local.key ]; then - echo $'Error: missing local key' - any_key - return + if [ ! -f /etc/tripwire/${HOSTNAME}-local.key ]; then + if [ -f /etc/tripwire/${PROJECT_NAME}-local.key ]; then + mv /etc/tripwire/${PROJECT_NAME}-local.key /etc/tripwire/${HOSTNAME}-local.key + mv /etc/tripwire/${PROJECT_NAME}-site.key /etc/tripwire/${HOSTNAME}-site.key + else + echo $'Error: missing local key' + any_key + return + fi fi clear echo $'Turing off logging...' @@ -1338,11 +1343,11 @@ function reset_tripwire { echo $'Creating configuration...' echo ' - ' | twadmin --create-cfgfile -S /etc/tripwire/${PROJECT_NAME}-site.key /etc/tripwire/twcfg.txt + ' | twadmin --create-cfgfile -S /etc/tripwire/${HOSTNAME}-site.key /etc/tripwire/twcfg.txt echo $'Resetting policy...' echo ' - ' | twadmin --create-polfile -S /etc/tripwire/${PROJECT_NAME}-site.key /etc/tripwire/twpol.txt + ' | twadmin --create-polfile -S /etc/tripwire/${HOSTNAME}-site.key /etc/tripwire/twpol.txt echo $'Creating tripwire database' echo '