среда, 17 августа 2011 г.

NOD32 update (FREEBSD+APACHE)

#!/usr/local/bin/bash

touch /root/nod32_start_$(date +%d-%m-%Y-%H:%M:%S)

export CURDIR="/usr/local/www/nod32"
export USERESET="ИМЯ"
export PASSESET="ПАРОЛЬ"

cd $CURDIR

wget -q --timestamping http://update.eset.com/eset_upd/update.ver &&

mv -f update.ver update.rar &&
cd $CURDIR/eset_upd &&
unrar e -y ../update.rar . &&
cd $CURDIR &&
mv update.rar update.ver &&

grep file= eset_upd/update.ver | \
grep "file=/download/" | \
sed -e 's/file\=/http\:\/\/um10.eset.com/' | \
grep engine3 | \
grep -v data > downlist1.txt

grep file= eset_upd/update.ver | \
grep "file=/download/" | \
sed -e 's/file\=/http\:\/\/um10.eset.com/' | \
grep engine3ess | \
grep -v data > downlist2.txt

grep file= eset_upd/update.ver | \
grep "file=/download/" | \
sed -e 's/file\=/http\:\/\/um10.eset.com/' | \
grep v3 | \
grep -v data > downlist3.txt

grep file= eset_upd/update.ver | \
grep "file=/download/" | \
sed -e 's/file\=/http\:\/\/um10.eset.com/' | \
grep emsx | \
grep -v data > downlist4.txt

cd $CURDIR/download/engine3/ &&
wget --timestamping --http-user=$USERESET \
--http-password=$PASSESET \
--input-file=../../downlist1.txt \
--user-agent="ESS Update (Windows; U; \
32bit; VDB 7001; BPC 4.0.474.0; \
OS: 5.1.2600 SP 3.0 NT; CH 0.0; LNG 1049; \
x32c; UPD http://um10.eset.com; \
APP ess; BEO 1; CPU 5964; ASP 0.0)"

cd $CURDIR/download/engine3ess/ &&
wget --timestamping --http-user=$USERESET \
--http-password=$PASSESET \
--input-file=../../downlist2.txt \
--user-agent="ESS Update (Windows; U; \
32bit; VDB 7001; BPC 4.0.474.0; \
OS: 5.1.2600 SP 3.0 NT; CH 0.0; LNG 1049; \
x32c; UPD http://um10.eset.com; \
APP ess; BEO 1; CPU 5964; ASP 0.0)"

cd $CURDIR/download/win/v3/ &&
wget --timestamping --http-user=$USERESET \
--http-password=$PASSESET \
--input-file=../../../downlist3.txt \
--user-agent="ESS Update (Windows; U; \
32bit; VDB 7001; BPC 4.0.474.0; \
OS: 5.1.2600 SP 3.0 NT; CH 0.0; LNG 1049; \
x32c; UPD http://um10.eset.com; \
APP ess; BEO 1; CPU 5964; ASP 0.0)"

cd $CURDIR/download/win/emsx/ &&
wget --timestamping --http-user=$USERESET \
--http-password=$PASSESET \
--input-file=../../../downlist4.txt \
--user-agent="ESS Update (Windows; U; \
32bit; VDB 7001; BPC 4.0.474.0; \
OS: 5.1.2600 SP 3.0 NT; CH 0.0; LNG 1049; \
x32c; UPD http://um10.eset.com; \
APP ess; BEO 1; CPU 5964; ASP 0.0)"


touch /root/nod32_end_$(date +%d-%m-%Y-%H:%M:%S)