Вот это у меня работает
#!/bin/bash
WGET=`which wget`
WGET_OPT="-N --cache=off"
MV=`which mv`
RM=`which rm`
FIND=`which find`
SED=`which sed`
CONVERT=`which dos2unix`
UNPACK=`which unrar`
CHMOD=`which chmod`
MIN_FSIZE=1000
SERVER="http://u26.eset.com"
cd /var/www/html/nod32
$WGET $WGET_OPT $SERVER/nod_eval/update.ver
$MV -f update.ver update.rar
$UNPACK x -y update.rar
FSIZE=`du -b update.ver|awk '{if($1~/[0-9]/) print $1}'`
while [ $FSIZE -lt $MIN_FSIZE ]; do
sleep 20
$WGET $WGET_OPT $SERVER/nod_eval/update.ver
$MV -f update.ver update.rar
$UNPACK x -y update.rar
FSIZE=`du -b update.ver|awk '{if($1~/[0-9]/) print $1}'`
done
$SED s/\\/eval\\/engine/\\/nod32\\/eval\\/engine/ update.ver > update.tmp
$CONVERT update.ver
FILES=`grep "file=" /var/www/html/nod32/update.ver|sed s/file=//`
for UPDFILES in $FILES; do
$WGET $WGET_OPT $SERVER$UPDFILES
done
$MV -f update.tmp update.ver
$RM -f update.rar
$FIND /var/www/html/nod32/ -type f -exec chmod 644 {} \;