diff --git a/src/freedombone-base-tripwire b/src/freedombone-base-tripwire index b76e26d04c140ed0ed67204dbe3687e4ae0d3ebc..fbfba23e0de1aab2b29071a4fd72aea35ace8c85 100755 --- a/src/freedombone-base-tripwire +++ b/src/freedombone-base-tripwire @@ -80,10 +80,17 @@ function install_tripwire { echo 'TEMPDIRECTORY =/tmp'; echo "MAILFROMADDRESS =tripwire@\$(HOSTNAME)"; } > /etc/tripwire/twcfg.txt + if [ -f "/etc/tripwire/${HOSTNAME}-local.key" ]; then + rm "/etc/tripwire/${HOSTNAME}-local.key" + fi echo ' ' | twadmin --generate-keys -L "/etc/tripwire/${HOSTNAME}-local.key" -S "/etc/tripwire/${HOSTNAME}-site.key" + if [ -f "/etc/tripwire/${HOSTNAME}-site.key" ]; then + rm "/etc/tripwire/${HOSTNAME}-site.key" + fi + echo ' ' | twadmin --create-cfgfile -S "/etc/tripwire/${HOSTNAME}-site.key" /etc/tripwire/twcfg.txt @@ -142,6 +149,10 @@ function install_tripwire { # site key name sed -i "s|\$(TWETC)/site.key|\$(TWETC)/\$(HOSTNAME)-site.key|g" /etc/tripwire/twpol.txt + if [ -f "/etc/tripwire/${HOSTNAME}-site.key" ]; then + rm "/etc/tripwire/${HOSTNAME}-site.key" + fi + # create the policy echo '