Skip to content
Snippets Groups Projects
Commit 14f65abd authored by Bob Mottram's avatar Bob Mottram
Browse files

Improve tripwire install so there is no prompt to overwrite

parent 476590c1
No related branches found
No related tags found
No related merge requests found
......@@ -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 '
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment