Commit 6d5f28fa authored by m33m33's avatar m33m33
Browse files

update

parent b76720dd
......@@ -19,10 +19,10 @@ ADDED_ALERT=1
AIDE_UPDATE=0
# You may want to point to a specific aide configuration file, depending on your setup and distribution
AIDE=aide
if [ -f /etc/debian_version ]; then
if [ -f "/etc/debian_version" ]; then
AIDE="aide -c /etc/aide/aide.conf"
fi
if [ -f /etc/redhat-release ]; then
if [ -f "/etc/redhat-release" ]; then
AIDE="aide -c /etc/aide.conf"
fi
......@@ -33,7 +33,8 @@ MYHOST=`hostname`
MYIP=`hostname -i`
ALERTRV=0
TMP=/var/lib/aide/aideCheck.$$.txt
AIDE="aide -c /etc/aide/aide.conf"
nbLinesAdded=0
nbLinesChanged=0
umask 077
......@@ -63,20 +64,25 @@ nice $AIDE --check > $TMP
# Look for issues, alert if any
if [ $CHANGED_ALERT -eq 1 ]; then
cat $TMP |grep -e "^changed:" > $TMP.aideFail
cat $TMP |grep -e "^changed:" > $TMP.aideFail.changed
touch $TMP.aideFail.changed
nbLinesChanged=`wc -l $TMP.aideFail.changed | awk '{print $1}'`
fi
if [ $ADDED_ALERT -eq 1 ]; then
echo "============================================================" >> $TMP.aideFail
cat $TMP |grep -e "^added:" >> $TMP.aideFail
cat $TMP |grep -e "^added:" > $TMP.aideFail.added
touch $TMP.aideFail.added
nbLinesAdded=`wc -l $TMP.aideFail.added | awk '{print $1}'`
fi
touch $TMP.aideFail
nbLines=`wc -l $TMP.aideFail | awk '{print $1}'`
nbLines=`expr $nbLinesAdded + $nbLinesChanged`
if [ $nbLines -ne 0 ]; then
ALERTRV=1
echo "You may want to look at this summary, and attached full report:" >> $TMP.mailReport
echo "============================================================" >> $TMP.mailReport
cat $TMP.aideFail >> $TMP.mailReport
cat $TMP.aideFail.changed >> $TMP.mailReport
echo "============================================================" >> $TMP.mailReport
cat $TMP.aideFail.added >> $TMP.mailReport
echo "============================================================" >> $TMP.mailReport
echo " " >> $TMP.mailReport
echo " " >> $TMP.mailReport
......@@ -94,7 +100,7 @@ if [ $nbLines -ne 0 ]; then
fi
fi
rm -f $TMP $TMP.mailReport $TMP.aideFail
rm -f $TMP $TMP.mailReport $TMP.aideFail $TMP.aideFail.added $TMP.aideFail.changed
# This script return value may be used to chain scripts
exit $ALERTRV
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment