tripwire-open-source/contrib/tripwire-check

24 lines
802 B
Bash
Executable File

#!/bin/sh
#
# Tripwire cron script borrowed from Linux and modified for generic situations.
# You should of course change path names to suit your environment.
#
# Contributed by Timothy K Ewing <Timothy.Ewing@celera.com>
#
HOST_NAME=`uname -n`
TWCFG_PATH=/usr/local/etc
TWDB_PATH=/usr/local/lib/tripwire
TWROOT_PATH=/usr/local/sbin
MAILTO="root" # Email addresses that should recieve reports
#
# Define checks which alert user to misconfiguration or run the check
#
if [ ! -e ${TWDB_PATH}/${HOST_NAME}.twd ]; then
echo "**** Error: Tripwire database for ${HOST_NAME} not found. ****"
echo "**** Verify tripwire was installed and/or "tripwire --init". ****"
else
test -f ${TWCFG_PATH}/tw.cfg && ${TWROOT_PATH}/tripwire --check | \
mail -s "${HOST_NAME} tripwire-check" ${MAILTO}
fi