Steve Grubb ac8743
--- aide-0.12/contrib/gpg2_check.sh.spc	2007-06-21 12:37:06.000000000 -0400
Steve Grubb ac8743
+++ aide-0.12/contrib/gpg2_check.sh	2007-06-21 12:39:53.000000000 -0400
Steve Grubb ac8743
@@ -1,32 +1,32 @@
Steve Grubb ac8743
-#!/bin/sh
Steve Grubb ac8743
-# $Id: gpg2_check.sh,v 1.1 2006/01/22 20:25:37 rvdb Exp $
Steve Grubb ac8743
-
Steve Grubb ac8743
-# Script by Vincent Danen <vdanen@linsec.ca>
Steve Grubb ac8743
-
Steve Grubb ac8743
-hostname=`uname -n`
Steve Grubb ac8743
-echo "AIDE integrity check for ${hostname} beginning (`date`)"
Steve Grubb ac8743
-echo ""
Steve Grubb ac8743
-if [ ! -e /var/lib/aide/aide.db ] ; then
Steve Grubb ac8743
-    echo "**** Error: AIDE database for ${hostname} not found."
Steve Grubb ac8743
-    echo "**** Run 'aide --init' and move the appropriate database file."
Steve Grubb ac8743
-else
Steve Grubb ac8743
-    if [ -f /etc/aide.conf ]; then
Steve Grubb ac8743
-        if [ -f /var/lib/aide/aide.db.sig ]; then
Steve Grubb ac8743
-	    pushd /var/lib/aide >/dev/null
Steve Grubb ac8743
-	        echo "Verifying the GPG signature on the database..."
Steve Grubb ac8743
-		echo ""
Steve Grubb ac8743
-	        gpg --verify aide.db.sig
Steve Grubb ac8743
-		echo ""
Steve Grubb ac8743
-		if [ "$?" == "1" ]; then
Steve Grubb ac8743
-		    echo "************************************************************"
Steve Grubb ac8743
-		    echo "GPG signature FAILED!  Your database has been tampered with!"
Steve Grubb ac8743
-		    echo "************************************************************"
Steve Grubb ac8743
-		    exit 1
Steve Grubb ac8743
-		fi
Steve Grubb ac8743
-	    popd >/dev/null
Steve Grubb ac8743
-	fi
Steve Grubb ac8743
-        nice -20 /usr/sbin/aide --check 2>/dev/null
Steve Grubb ac8743
-    fi
Steve Grubb ac8743
-fi
Steve Grubb ac8743
-
Steve Grubb ac8743
-exit 0
Steve Grubb ac8743
+#!/bin/sh
Steve Grubb ac8743
+# $Id: gpg2_check.sh,v 1.1 2006/01/22 20:25:37 rvdb Exp $
Steve Grubb ac8743
+
Steve Grubb ac8743
+# Script by Vincent Danen <vdanen@linsec.ca>
Steve Grubb ac8743
+
Steve Grubb ac8743
+hostname=`uname -n`
Steve Grubb ac8743
+echo "AIDE integrity check for ${hostname} beginning (`date`)"
Steve Grubb ac8743
+echo ""
Steve Grubb ac8743
+if [ ! -e /var/lib/aide/aide.db ] ; then
Steve Grubb ac8743
+    echo "**** Error: AIDE database for ${hostname} not found."
Steve Grubb ac8743
+    echo "**** Run 'aide --init' and move the appropriate database file."
Steve Grubb ac8743
+else
Steve Grubb ac8743
+    if [ -f /etc/aide.conf ]; then
Steve Grubb ac8743
+        if [ -f /var/lib/aide/aide.db.sig ]; then
Steve Grubb ac8743
+	    pushd /var/lib/aide >/dev/null
Steve Grubb ac8743
+	        echo "Verifying the GPG signature on the database..."
Steve Grubb ac8743
+		echo ""
Steve Grubb ac8743
+	        gpg --verify aide.db.sig
Steve Grubb ac8743
+		echo ""
Steve Grubb ac8743
+		if [ "$?" == "1" ]; then
Steve Grubb ac8743
+		    echo "************************************************************"
Steve Grubb ac8743
+		    echo "GPG signature FAILED!  Your database has been tampered with!"
Steve Grubb ac8743
+		    echo "************************************************************"
Steve Grubb ac8743
+		    exit 1
Steve Grubb ac8743
+		fi
Steve Grubb ac8743
+	    popd >/dev/null
Steve Grubb ac8743
+	fi
Steve Grubb ac8743
+        nice -20 /usr/sbin/aide --check 2>/dev/null
Steve Grubb ac8743
+    fi
Steve Grubb ac8743
+fi
Steve Grubb ac8743
+
Steve Grubb ac8743
+exit 0
Steve Grubb ac8743
--- aide-0.12/contrib/gpg2_update.sh.spc	2007-06-21 12:37:24.000000000 -0400
Steve Grubb ac8743
+++ aide-0.12/contrib/gpg2_update.sh	2007-06-21 12:39:43.000000000 -0400
Steve Grubb ac8743
@@ -1,52 +1,52 @@
Steve Grubb ac8743
-#!/bin/sh
Steve Grubb ac8743
-# $Id: gpg2_update.sh,v 1.1 2006/01/22 20:25:37 rvdb Exp $
Steve Grubb ac8743
-#
Steve Grubb ac8743
-# script to update and rotate the AIDE database files and, optionally
Steve Grubb ac8743
-# create a detached GPG signature to verify the database file
Steve Grubb ac8743
-#
Steve Grubb ac8743
-# written by Vincent Danen <vdanen-at-annvix.org> 01/21/2006
Steve Grubb ac8743
-
Steve Grubb ac8743
-usegpg=0
Steve Grubb ac8743
-
Steve Grubb ac8743
-if [ -f /root/.gnupg/secring.gpg ]; then
Steve Grubb ac8743
-    usegpg=1
Steve Grubb ac8743
-fi
Steve Grubb ac8743
-
Steve Grubb ac8743
-if [ ! -d /var/lib/aide ]; then
Steve Grubb ac8743
-    echo "The AIDE database directory /var/lib/aide does not exist!"
Steve Grubb ac8743
-    exit 1
Steve Grubb ac8743
-fi
Steve Grubb ac8743
-
Steve Grubb ac8743
-pushd /var/lib/aide >/dev/null
Steve Grubb ac8743
-
Steve Grubb ac8743
-# copy the old database
Steve Grubb ac8743
-if [ -f aide.db ]; then
Steve Grubb ac8743
-    newfile="aide-`hostname`-`date +%Y%m%d-%H%M%S`.db"
Steve Grubb ac8743
-    if [ "${usegpg}" == 1 -a -f aide.db.sig ]; then
Steve Grubb ac8743
-        # do an integrity check
Steve Grubb ac8743
-	gpg --verify aide.db.sig
Steve Grubb ac8743
-	if [ "$?" == "1" ]; then
Steve Grubb ac8743
-	    echo "************************************************************"
Steve Grubb ac8743
-	    echo "GPG signature FAILED!  Your database has been tampered with!"
Steve Grubb ac8743
-	    echo "************************************************************"
Steve Grubb ac8743
-	    exit 1
Steve Grubb ac8743
-	fi
Steve Grubb ac8743
-    fi
Steve Grubb ac8743
-    cp -av aide.db ${newfile} 
Steve Grubb ac8743
-    /usr/sbin/aide --update -B "database=file:/var/lib/aide/${newfile}" 
Steve Grubb ac8743
-    if [ "${usegpg}" == "1" ]; then
Steve Grubb ac8743
-	# create the signature file
Steve Grubb ac8743
-	[[ -f aide.db.sig ]] && rm -f aide.db.sig
Steve Grubb ac8743
-        gpg --detach-sign aide.db
Steve Grubb ac8743
-	if [ "$?" == "1" ]; then
Steve Grubb ac8743
-	    echo "FATAL:  Error occurred when creating the signature file!"
Steve Grubb ac8743
-	    exit 1
Steve Grubb ac8743
-	fi
Steve Grubb ac8743
-    fi
Steve Grubb ac8743
-    gzip -9f ${newfile}
Steve Grubb ac8743
-else
Steve Grubb ac8743
-    echo "The AIDE database does not exist, can't update!"
Steve Grubb ac8743
-    exit 1
Steve Grubb ac8743
-fi
Steve Grubb ac8743
-
Steve Grubb ac8743
-popd >/dev/null
Steve Grubb ac8743
+#!/bin/sh
Steve Grubb ac8743
+# $Id: gpg2_update.sh,v 1.1 2006/01/22 20:25:37 rvdb Exp $
Steve Grubb ac8743
+#
Steve Grubb ac8743
+# script to update and rotate the AIDE database files and, optionally
Steve Grubb ac8743
+# create a detached GPG signature to verify the database file
Steve Grubb ac8743
+#
Steve Grubb ac8743
+# written by Vincent Danen <vdanen-at-annvix.org> 01/21/2006
Steve Grubb ac8743
+
Steve Grubb ac8743
+usegpg=0
Steve Grubb ac8743
+
Steve Grubb ac8743
+if [ -f /root/.gnupg/secring.gpg ]; then
Steve Grubb ac8743
+    usegpg=1
Steve Grubb ac8743
+fi
Steve Grubb ac8743
+
Steve Grubb ac8743
+if [ ! -d /var/lib/aide ]; then
Steve Grubb ac8743
+    echo "The AIDE database directory /var/lib/aide does not exist!"
Steve Grubb ac8743
+    exit 1
Steve Grubb ac8743
+fi
Steve Grubb ac8743
+
Steve Grubb ac8743
+pushd /var/lib/aide >/dev/null
Steve Grubb ac8743
+
Steve Grubb ac8743
+# copy the old database
Steve Grubb ac8743
+if [ -f aide.db ]; then
Steve Grubb ac8743
+    newfile="aide-`hostname`-`date +%Y%m%d-%H%M%S`.db"
Steve Grubb ac8743
+    if [ "${usegpg}" == 1 -a -f aide.db.sig ]; then
Steve Grubb ac8743
+        # do an integrity check
Steve Grubb ac8743
+	gpg --verify aide.db.sig
Steve Grubb ac8743
+	if [ "$?" == "1" ]; then
Steve Grubb ac8743
+	    echo "************************************************************"
Steve Grubb ac8743
+	    echo "GPG signature FAILED!  Your database has been tampered with!"
Steve Grubb ac8743
+	    echo "************************************************************"
Steve Grubb ac8743
+	    exit 1
Steve Grubb ac8743
+	fi
Steve Grubb ac8743
+    fi
Steve Grubb ac8743
+    cp -av aide.db ${newfile} 
Steve Grubb ac8743
+    /usr/sbin/aide --update -B "database=file:/var/lib/aide/${newfile}" 
Steve Grubb ac8743
+    if [ "${usegpg}" == "1" ]; then
Steve Grubb ac8743
+	# create the signature file
Steve Grubb ac8743
+	[[ -f aide.db.sig ]] && rm -f aide.db.sig
Steve Grubb ac8743
+        gpg --detach-sign aide.db
Steve Grubb ac8743
+	if [ "$?" == "1" ]; then
Steve Grubb ac8743
+	    echo "FATAL:  Error occurred when creating the signature file!"
Steve Grubb ac8743
+	    exit 1
Steve Grubb ac8743
+	fi
Steve Grubb ac8743
+    fi
Steve Grubb ac8743
+    gzip -9f ${newfile}
Steve Grubb ac8743
+else
Steve Grubb ac8743
+    echo "The AIDE database does not exist, can't update!"
Steve Grubb ac8743
+    exit 1
Steve Grubb ac8743
+fi
Steve Grubb ac8743
+
Steve Grubb ac8743
+popd >/dev/null