Subversion Repositories My Stuff

Compare Revisions

Ignore whitespace Rev 19 → Rev 20

/trunk/Bash/chkrootkit_cron.sh
0,0 → 1,35
#!/bin/sh
 
#####################################################################
# Script to send an email when chkrootkit test are being performed
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# Author: Andrzej Kardaƛ
# License: GPLv3
# The full version of the licencse can be obtainted by visiting:
# http://www.gnu.org/licenses/gpl.html
#######################################################################
 
SERVERNAME=$(hostname)
DATE=$(date +"%d.%m.%Y")
EMAIL=admin@kardasa.pl
FILENAME="/var/tmp/fulltest-${DATE}.txt"
 
/usr/sbin/chkrootkit 2>&1 > ${FILENAME}
 
if (cat ${FILENAME} | grep -q "INFECTED\|Vulnerable") then
echo "There seems to be a problem!!!! > /var/tmp/msgfile-${DATE}
echo "-------------------------------------------------" >> /var/tmp/msgfile-${DATE}
cat ${FILENAME} | grep "INFECTED\|Vulnerable >> /var/tmp/msgfile-${DATE}
echo "-------------------------------------------------" >> /var/tmp/msgfile-${DATE}
echo "You can see whole test results in attachment file" >> /var/tmp/msgfile-${DATE}
else
echo "Your system is not infected" > /var/tmp/msgfile-${DATE}
echo "You can see whole test results in attachment file" >> /var/tmp/msgfile-${DATE}
fi
 
/usr/bin/mutt -s "${DATE} Weekly chkrootkit from ${SERVERNAME}" ${EMAIL} -a ${FILENAME} < /var/tmp/msgfile-${DATE}
#
Property changes:
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property