Shell Skript: Sophos Update Script
Wenn Sie Sophos von ihrem Server installiert haben und auch davon die Updates beziehen, kennen Sie sicher das lästige Updaten der Virendefinitionsdateien. Dieses Skript übernimmt diese Aufgabe für Sie. Bevor Sie das Skript verwenden können sollten Sie die Variablen IDEFILE, DOWNLOADDIR, SOPHOSDIR und eventuell LOGFILE anpassen. Danach können Sie das Skript als Cronjob eintragen.
###########################################################################
## ##
## Sophos Update Script ##
## ##
## Creation: 26.11.2004 ##
## Last Update: 19.06.2005 ##
## ##
## Copyright (c) 2004-2005 by Georg Kainzbauer <http://www.gtkdb.de> ##
## ##
## This program is free software; you can redistribute it and/or modify ##
## it under the terms of the GNU General Public License as published by ##
## the Free Software Foundation; either version 2 of the License, or ##
## (at your option) any later version. ##
## ##
###########################################################################
#!/bin/bash
IDEURL=http://www.sophos.com/downloads/ide/
IDEFILE=394_ides.zip
DOWNLOADDIR=/data/public/AntiVirus/
SOPHOSDIR=/data/public/AntiVirus/i386/
LOGFILE=/var/log/mylogs/sophos_update.log
echo `date "+%b %e %X"`: Deleting old IDE file >> ${LOGFILE}
cd ${DOWNLOADDIR}
IDEOLD=`md5sum ${IDEFILE}`
rm ${IDEFILE}
echo `date "+%b %e %X"`: Downloading newest IDE file >> ${LOGFILE}
wget ${IDEURL}${IDEFILE}
echo `date "+%b %e %X"`: Checking new version >> ${LOGFILE}
IDENEW=`md5sum ${IDEFILE}`
if [ "$IDEOLD" == "$IDENEW" ]
then
echo `date "+%b %e %X"`: No new IDE file available >> ${LOGFILE}
exit 0
else
echo `date "+%b %e %X"`: Unzip newest IDE file >> ${LOGFILE}
unzip -o ${IDEFILE} -d ${SOPHOSDIR}
echo `date "+%b %e %X"`: Updating Sophos installation file >> ${LOGFILE}
COUNT=`cat -v ${SOPHOSDIR}sav.cfg | grep Serial | cut -d '=' -f 2 | cut -d '^' -f 1`
COUNT=`expr ${COUNT} + 1`
echo [Rollout] > ${SOPHOSDIR}sav.cfg
echo SerialNumber=${COUNT} >> ${SOPHOSDIR}sav.cfg
echo `date "+%b %e %X"`: New SerialNumber: ${COUNT} >> ${LOGFILE}
exit 0
fi
## ##
## Sophos Update Script ##
## ##
## Creation: 26.11.2004 ##
## Last Update: 19.06.2005 ##
## ##
## Copyright (c) 2004-2005 by Georg Kainzbauer <http://www.gtkdb.de> ##
## ##
## This program is free software; you can redistribute it and/or modify ##
## it under the terms of the GNU General Public License as published by ##
## the Free Software Foundation; either version 2 of the License, or ##
## (at your option) any later version. ##
## ##
###########################################################################
#!/bin/bash
IDEURL=http://www.sophos.com/downloads/ide/
IDEFILE=394_ides.zip
DOWNLOADDIR=/data/public/AntiVirus/
SOPHOSDIR=/data/public/AntiVirus/i386/
LOGFILE=/var/log/mylogs/sophos_update.log
echo `date "+%b %e %X"`: Deleting old IDE file >> ${LOGFILE}
cd ${DOWNLOADDIR}
IDEOLD=`md5sum ${IDEFILE}`
rm ${IDEFILE}
echo `date "+%b %e %X"`: Downloading newest IDE file >> ${LOGFILE}
wget ${IDEURL}${IDEFILE}
echo `date "+%b %e %X"`: Checking new version >> ${LOGFILE}
IDENEW=`md5sum ${IDEFILE}`
if [ "$IDEOLD" == "$IDENEW" ]
then
echo `date "+%b %e %X"`: No new IDE file available >> ${LOGFILE}
exit 0
else
echo `date "+%b %e %X"`: Unzip newest IDE file >> ${LOGFILE}
unzip -o ${IDEFILE} -d ${SOPHOSDIR}
echo `date "+%b %e %X"`: Updating Sophos installation file >> ${LOGFILE}
COUNT=`cat -v ${SOPHOSDIR}sav.cfg | grep Serial | cut -d '=' -f 2 | cut -d '^' -f 1`
COUNT=`expr ${COUNT} + 1`
echo [Rollout] > ${SOPHOSDIR}sav.cfg
echo SerialNumber=${COUNT} >> ${SOPHOSDIR}sav.cfg
echo `date "+%b %e %X"`: New SerialNumber: ${COUNT} >> ${LOGFILE}
exit 0
fi
Dieser Eintrag wurde am 26.11.2004 erstellt und zuletzt am 05.04.2015 bearbeitet.
Direkter Link zu dieser Seite: http://www.gtkdb.de/index_7_847.html
[ Zur Startseite ] [ Zur Kategorie ]
© 2004-2021 by Georg Kainzbauer