#!/bin/bash
cd /var/www/html/virus
i=""
wget 2>&1>/dev/null
sleep 1
down=$(tail -n 6 index.html |head -n 1|awk -F'"' '{print $8}')
ls /var/www/html/virus/${down} |grep ${down} 2>&1 > /dev/null
p="$?"
case $p in
0) echo you have down the patch $p ;
rm index.html* log* -f ;
sleep 10;
exit ;;
1)
wget -nH --cut-dirs=4 -r --tries=100 -c ${i}${down} -o log ;;
*)
echo error please check $p ;
sleep 20 ;
exit ;;
esac
sleep 10
rm -f index.html* log*
cp /etc/mail/spamassassin/message /tmp/ok
echo " `date "+%F %H:%M:%S"`">>/tmp/ok
echo " " >> /tmp/ok
echo " " >> /tmp/ok
echo " 升级地址: }" >>/tmp/ok
echo " " >> /tmp/ok
echo " " >> /tmp/ok
echo " " >> /tmp/ok
echo " " >> /tmp/ok
echo " " >> /tmp/ok
sleep 2
mail -s "anti-virus update in `date \"+%Y/%m/%d %H%M%S\"` " < /tmp/ok
rm -f /tmp/ok
rm -f /home/software/tools/sdat*
rm -f /home/software/tools/Anti-virus/sdat*
cp /var/www/html/virus/${down} /home/software/tools/
cp /var/www/html/virus/${down} /home/software/tools/Anti-virus
阅读(1513) | 评论(0) | 转发(0) |