Aggiornamento automatico di vscanx

annuncio pubblicitario
√ www.kdev.it
Aggiornamento automatico di vscanx
Questo script vi permette di aggiornare automaticamente le liste di definizione di vscan in modo tale da avere un'antivirus
sempre aggiornato ed efficace senza dover intervenire manualmente sul vostro server.
Aggiornamento automatico delle liste di definizione virus per il content filtering.
Questo script vi permette di auto-aggiornare le liste di definizione di virex a un'intervallo di tempo schedulato.
E' richiesto wget un comando simile a curl.
E' disponibile il porting del comando nella 'area downloads del sito Apple© all'indirizzo:
http://www.apple.com/downloads/macosx/unix_open_source/wget.html.
Sacricatelo e installatelo.
Lo script:
#!/bin/sh
UVSBASE="/usr/share/vscanx/vscanx"
URLBASE="http://download.nai.com/products/datfiles/4.x/nai"
FILBASE="/tmp/uvupdate.$$"
DIRBASE="/usr/share/vscanx"
download () {
echo "Downloading \"$2\""
/usr/local/bin/wget --quiet --output-document="$1" "$2"
if test "$?" -ne "0" ; then
echo "Unable to download \"$2\""
exit 1
fi
}
trap "rm -rf $FILBASE.*" 0 1 2 3 15
download "$FILBASE.ini" "$URLBASE/update.ini"
http://www.kdev.it/joomla
Powered by Joomla!
Generated: 8 June, 2017, 00:35
√ www.kdev.it
DAT=`cat "$FILBASE.ini" | sed 's|
||g' | egrep '^FileName=dat-(.*)\.zip' | cut -d= -f2-`
DIR=`basename $DAT .zip`
if test -d "$DIRBASE/$DIR" ; then
echo "Virus definition \"$DIR\" already available."
exit 0
fi
download "$FILBASE.zip" "$URLBASE/$DAT"
echo "Extracting virus definition archive"
unzip -qq "$FILBASE.zip" '*.dat' -d "$DIRBASE/$DIR"
if test "$?" -ne "0" ; then
echo "Unable to unzip DAT archive file"
exit 1
fi
echo "Testing new virus definitions"
/usr/bin/env LD_LIBRARY_PATH=$UVSBASE/vscanx $UVSBASE --dat "$DIRBASE/$DIR" --recursive "$UVSBASE"
if test "$?" -ne "0" ; then
rm -rf "$DIRBASE/$DIR"
echo "Virus definitions test failed"
exit 1
fi
echo "Removing obsolete virus definitions:\c"
for DAT in `find /usr/share/vscanx/ -name 'dat-*' -type d | sort -r | tail +4` ; do
echo " `basename $DAT`\c"
rm -rf $DAT
done
echo ". Done."
http://www.kdev.it/joomla
Powered by Joomla!
Generated: 8 June, 2017, 00:35
√ www.kdev.it
echo "Setting \"$DIR\" to current virus data file"
rm -f "$DIRBASE/dat-latest"
ln -sf "$DIR" "$DIRBASE/dat-latest"
rm -Rf $DIRBASE/clean.dat"
rm -Rf $DIRBASE/internet.dat"
rm -Rf $DIRBASE/names.dat"
rm -Rf $DIRBASE/scan.dat"
ln -sf "$DIR/clean.dat" "$DIRBASE"
ln -sf "$DIR/internet.dat" "$DIRBASE"
ln -sf "$DIR/names.dat" "$DIRBASE"
ln -sf "$DIR/scan.dat" "$DIRBASE"
Questo é lo script, adeguate i percorsi alla posizione dei vostri files definite nelle variabili all'inizio dello
scriptUVSBASE="/usr/share/vscanx/vscanx"
URLBASE="http://download.nai.com/products/datfiles/4.x/nai"
FILBASE="/tmp/uvupdate.$$"
DIRBASE="/usr/share/vscanx"
Lo script deve avere dei privilegi di esecuzione quindi eseguite un chmod 0333 del file!
Inserite lo script negli scheduled cron jobs con l'intervallo che ritenete più opportuno e il vostro antivirus sarà
automaticamente aggiornato.
http://www.kdev.it/joomla
Powered by Joomla!
Generated: 8 June, 2017, 00:35
Scarica