#! /bin/sh TMPDIR=/tmp GEODIR=/usr/share/GeoIP DAT=GeoIP.dat cd $TMPDIR /usr/bin/wget http://www.maxmind.com/download/geoip/database/$DAT.gz if [ $? != 0 ] ; then echo "wget failed" exit 1 fi /bin/gunzip $DAT.gz if [ $? != 0 ] ; then echo "gunzip failed" exit 2 fi cd $GEODIR /bin/mv $DAT $DAT.`/bin/date "+%Y%m%d-%H%M%S"` /bin/mv $TMPDIR/$DAT .