Sophie

Sophie

distrib > CentOS > 5 > x86_64 > by-pkgid > 9b9ba44143769f7201686b53946cf2e4 > files > 12

aide-0.13.1-8.el5.x86_64.rpm

#!/bin/sh
# $Id: gpg2_check.sh,v 1.1 2006/01/22 20:25:37 rvdb Exp $

# Script by Vincent Danen <vdanen@linsec.ca>

hostname=`uname -n`
echo "AIDE integrity check for ${hostname} beginning (`date`)"
echo ""
if [ ! -e /var/lib/aide/aide.db ] ; then
    echo "**** Error: AIDE database for ${hostname} not found."
    echo "**** Run 'aide --init' and move the appropriate database file."
else
    if [ -f /etc/aide.conf ]; then
        if [ -f /var/lib/aide/aide.db.sig ]; then
	    pushd /var/lib/aide >/dev/null
	        echo "Verifying the GPG signature on the database..."
		echo ""
	        gpg --verify aide.db.sig
		echo ""
		if [ "$?" == "1" ]; then
		    echo "************************************************************"
		    echo "GPG signature FAILED!  Your database has been tampered with!"
		    echo "************************************************************"
		    exit 1
		fi
	    popd >/dev/null
	fi
        nice -20 /usr/sbin/aide --check 2>/dev/null
    fi
fi

exit 0