#! /bin/sh
# Helmut Hullen Oktober 2003
# 04-02-06 leere Eintrge abgeblockt
# 04-01-30 "chown" gendert
#          Datums-Eintrag in "wget.log"

PATH=$PATH:/bin:/usr/bin

FProt=/home/adm/Viren
Ziel=/home/adm/Viren/F-Prot
mkdir -p $FProt
cd $FProt

ping -q -c1 rtl.de > /dev/null 2>&1
ping -q -c1 rtl.de > /dev/null 2>&1 || exit

# /usr/bin/wget -nd --retr-symlinks -N --tries=3 \
# 	-a $FProt/wget.log -i $FProt/fprot.dat -P $FProt

echo ======== Update $(date) ======== >> $FProt/wget.log

while read Up
  do
	echo "$Up" | grep -q ftp || continue

	/usr/bin/wget -a $FProt/wget.log "$Up"

  done < $FProt/fprot.dat

echo ======== Update $(date) ======== >> $FProt/fprot-up.log

for Datei in $FProt/*.zip
   do
	test -f $Datei || continue
	unzip -u -o    -d $Ziel  $Datei >> $FProt/fprot-up.log
  
   done
chown -R adm.adm $Ziel
chmod -R a+rX $Ziel
chmod -R go-w $Ziel

# das war's
 