Update script untuk antivirus mcafee di linux
November 28th, 2007
Shellscript berikut akan melakukan update antivirus McAfee, jadul, tapi gpp, siapa tau ada yang butuh.
#!/bin/sh -x
#
# UVScan Updater
#
uvscan_dir=/usr/local/uvscan
tmp_dir=${uvscan_dir}/tmp
old_dat=${uvscan_dir}/old_dat
if [ ! -d ${uvscan_dir} ]; then
exit
fi
if [ ! -d ${tmp_dir} ]; then
mkdir -p ${tmp_dir}
fi
if [ ! -d ${old_dat} ]; then
mkdir -p ${old_dat}
fi
go_get () {
#wget http://download.nai.com/products/datfiles/4.x/nai/sdat${new_version}.exe || echo “failed to fetch!” && exit
wget –passive-ftp ftp://ftp.nai.com/pub/datfiles/english/dat-${new_version}.tar || exit
echo ${new_version} > current_version.txt
}
go_install () {
tar xf dat-${new_version}.tar -C ${uvscan_dir}
}
cd ${tmp_dir}
cp dat-${new_version}.tar ${old_dat}
rm -f ${tmp_dir}/{dat,update}*
wget –passive-ftp ftp://ftp.nai.com/pub/datfiles/english/update.ini || exit
new_version=`grep “FileName=dat” update.ini | awk ‘{ print substr($1,14,4) }’`
if [ -f current_version.txt ]; then
current_version=`cat current_version.txt`
else
go_get
fi
if [ “$current_version” -ge “$new_version” ]; then
#echo “No new .DATs available at this time”
#echo “Currently installed version: $current_version”
#echo “Version on FTP site: $new_version”
exit
else
go_get && go_install
fi