Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 08 Feb 2001 10:39:11 +0200
From:      Ertan Kucukoglu <ertank@ozlerplastik.com>
To:        questions@freebsd.org
Subject:   script problem (off topic)
Message-ID:  <3A825B2F.B7A1FA80@ozlerplastik.com>

next in thread | raw e-mail | index | archive | help
Hello,

I have a script to update my virus definitions every night. I use unzip
program it it. But, I always get errors indicating that unzip can not find
the required file. A part of original script output is below:

-------------------------------
Any cumulative update?
There is no cumulative update.
Get the daily update.

7339 bytes transferred in 3.5 seconds (2.04 kBps)
unzip: not found
Killed AvpBSDDaemon(65306)
Killed AvpBSDDaemon(65307)
-------------------------------

And, here is my running script:
-------------------------------
#! /bin/sh

FTP='ftp://ftp.avp.ru/updates_zip/'
TEST_FILE='avp'`date +'%y%m'`'.zip'
DOWNLOAD_FILE='daily.zip'
AVPDIR=/usr/local/share/AVP

# Check if we already have this month's update.
if ! test -f $AVPDIR/avp`date +'%y%m'`.avc; then
   # No we do not. Check if there is on ftp site.
   echo 'Any cumulative update?'
   if fetch -s $FTP$TEST_FILE; then
      echo 'There is new cumulative update.'
      cd /tmp
      if fetch $FTP$TEST_FILE; then
        cd $AVPDIR
        mkdir `date +'%y%m%d'`
        mv avp* *.avc `date +'%y%m%d'`
        # Move back the avpkeeper directory.
        mv `date +'%y%m'`/avpkeeper .
        cd /tmp
        unzip -o $TEST_FILE -d $AVPDIR
        # Restart AvpBSDDaemon to reflect changes.
        cd $AVPDIR
        ./AvpBSDDaemon -ka
        ./AvpBSDDaemon
        # All updates are done. Exit successfully.
        exit 0
      else
        echo 'ERROR: Can not download file '$TEST_FILE
        exit 1
      fi
   else
      echo 'There is no cumulative update.'
   fi
fi

echo 'Get the daily update.'
cd $AVPDIR
if fetch $FTP$DOWNLOAD_FILE; then
   cd $AVPDIR
   unzip -o $DOWNLOAD_FILE
   # Restart AvpBSDDaemon to reflect changes.
   ./AvpBSDDaemon -ka
   ./AvpBSDDaemon
   # Daily update is done. Exit successfully.
   exit 0
fi

echo 'ERROR: Can not download file '$DOWNLOAD_FILE
exit 1
-------------------------------

I can not figure out what is the problem. Can someone give me a hand?

Best Regards,

--
Ertan Kucukoglu
ertank@ozlerplastik.com


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3A825B2F.B7A1FA80>