initial commit of a *whole bunch* of old Egressive shell scripts, used to make many people redundant.
This commit is contained in:
commit
43e0f5b59e
329 changed files with 31937 additions and 0 deletions
78
egvscan/egvscan
Executable file
78
egvscan/egvscan
Executable file
|
@ -0,0 +1,78 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# egvscan
|
||||
#
|
||||
# (c) 2007 Egressive Limited
|
||||
# Virus scan of server storage using clamav
|
||||
# by rob@egressive.com 20070514
|
||||
#
|
||||
##
|
||||
# Description - egvscan:
|
||||
#
|
||||
#
|
||||
##
|
||||
#
|
||||
# Default Settings
|
||||
#
|
||||
DEBUG=false
|
||||
#
|
||||
if [ $DEBUG == "true" ] ; then
|
||||
echo "Default Settings"
|
||||
fi
|
||||
#
|
||||
# config file
|
||||
CONF_FILE=/etc/egscripts/egvscan/egvscan.conf
|
||||
# logfile
|
||||
LOGFILE=/var/log/egvscan.log # use logrotate to manage logs
|
||||
TMP_LOGFILE=/tmp/egvscan.$$
|
||||
#
|
||||
# Output by clamAV to indicate it has found a virus
|
||||
VIRUS_FOUND_WORD="FOUND$"
|
||||
#
|
||||
VSCAN_COMMAND=`which clamdscan`
|
||||
MAIL_COMMAND=`which mail`
|
||||
GREP_COMMAND=`which grep`
|
||||
TAIL_COMMAND=`which tail`
|
||||
NICE_COMMAND=`which nice`
|
||||
HEAD_COMMAND=`which head`
|
||||
CAT_COMMAND=`which cat`
|
||||
DATE_COMMAND=`which date`
|
||||
FIND_COMMAND=`which find`
|
||||
#
|
||||
DATE=`$DATE_COMMAND`
|
||||
echo "+++++++++++++++++++++++++++++++++++++++++++" >> $LOGFILE
|
||||
echo " Started virus scan ($DATE) " >> $LOGFILE
|
||||
#
|
||||
# initialise end status
|
||||
VSCAN_STATUS="[NO VIRUS DETECTED]"
|
||||
#
|
||||
# Get local configuration
|
||||
#
|
||||
if [ $DEBUG == "true" ] ; then
|
||||
echo "Get Local Settings"
|
||||
fi
|
||||
if [ -x /etc/egscripts/egvscan/egvscan.conf ] ; then
|
||||
. $CONF_FILE
|
||||
else
|
||||
$CAT_COMMAND $LOGFILE | $MAIL_COMMAND -s "[ERROR] Could not find config file for $SERVERNAME backup" $MAIL_TO
|
||||
exit 1
|
||||
fi
|
||||
#
|
||||
##
|
||||
echo " Scanning $i" >> $LOGFILE
|
||||
$NICE_COMMAND $VSCAN_COMMAND $VSCAN_ARGS -l $TMP_LOGFILE $SCAN_DIR 2>> $LOGFILE
|
||||
#
|
||||
if $GREP_COMMAND -c $VIRUS_FOUND_WORD $TMP_LOGFILE
|
||||
then
|
||||
$MAIL_COMMAND -s "[VIRUS DETECTED] on $SERVERNAME in a recently created or modified file" $MAIL_TO < $TMP_LOGFILE
|
||||
fi
|
||||
if [ -f $TMP_LOGFILE ]
|
||||
then
|
||||
cat $TMP_LOGFILE >> $LOGFILE
|
||||
rm $TMP_LOGFILE
|
||||
fi
|
||||
DATE=`$DATE_COMMAND`
|
||||
echo " Completed virus scan ($DATE) " >> $LOGFILE
|
||||
echo "+++++++++++++++++++++++++++++++++++++++++++" >> $LOGFILE
|
||||
echo "" >> $LOGFILE
|
||||
|
9
egvscan/egvscan-cron
Executable file
9
egvscan/egvscan-cron
Executable file
|
@ -0,0 +1,9 @@
|
|||
#
|
||||
# egbackup, copyright 2005 egressive limited, www.egressive.com
|
||||
#
|
||||
# run system backups
|
||||
#
|
||||
# every two hours at 37 min past the hour during the day, mon-sun
|
||||
# Change the scan period in /etc/egvscan.conf if you change this
|
||||
0 6,18 * * * root /etc/egscripts/egvscan/egvscan
|
||||
|
22
egvscan/egvscan.conf.example
Executable file
22
egvscan/egvscan.conf.example
Executable file
|
@ -0,0 +1,22 @@
|
|||
# Configuration Variables for egvscan
|
||||
#
|
||||
# Name of the server for the subject of the success/ failure
|
||||
#SERVERNAME="jimbo.egressive.com"
|
||||
SERVERNAME=""
|
||||
#
|
||||
# Arguments. --move puts infected files in a directory. DO NOT USE FOR SITES on mbox!!!
|
||||
VSCAN_ARGS="--move /storage/quarantine"
|
||||
#y
|
||||
# List of the directories to scan recursively. Seperate directories with a space
|
||||
SCAN_DIR="/home"
|
||||
# note this doesn't work yet. Will be used to exclude directories (eg /home/storage)
|
||||
SCAN_DIR_EXCLUDES=""
|
||||
# note this doesn't work yet. Will be used to exclude files based on name (eg *.mdb)
|
||||
SCAN_FILE_EXCLUDES=""
|
||||
# Allow some overlap - if the cron job runs every 120 mins, add 30 mins to get SCAN_PERIOD
|
||||
# Make sure the cron file agrees with this period.
|
||||
SCAN_PERIOD=750
|
||||
# mail account for sending success/ failure messages
|
||||
MAIL_TO="support@egressive.com"
|
||||
#
|
||||
##
|
7
egvscan/logrotate.d/egvscan
Normal file
7
egvscan/logrotate.d/egvscan
Normal file
|
@ -0,0 +1,7 @@
|
|||
/var/log/egvscan.log {
|
||||
daily
|
||||
missingok
|
||||
rotate 7
|
||||
compress
|
||||
notifempty
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue