#!/bin/bash ################################################################################ # # cc2asn_download # --------------- # # Download each of the sources as defined in the configuration file to the # defined data directory. There is no need to run this script more than once a # day, since the delegated files from the registrars are updated at that # frequency. # # Author: Tor Inge Skaar - Norwegian Honeynet Chapter - www.honeynor.no # ################################################################################ source "/etc/cc2asn.conf" ################################################################################ if [ ! -d $DATADIR ] then mkdir -p $DATADIR fi ecode=0 i=1 varname="SOURCE"$i while [ -n "${!varname}" ] do filename=`basename ${!varname}` echo -n "[$i] ${!varname}" wget -q -O $DATADIR/$filename ${!varname} if [ -e $DATADIR/$filename ] then egrep "allocated|assigned" $DATADIR/$filename > $DATADIR/$filename.data echo -e " - OK" else echo -e " - FAILED" ecode=1 fi let "i+=1" varname="SOURCE"$i done exit $ecode