diff options
author | Alin Năstac <mrness@gentoo.org> | 2009-02-18 21:44:38 +0000 |
---|---|---|
committer | Alin Năstac <mrness@gentoo.org> | 2009-02-18 21:44:38 +0000 |
commit | 12eb56b9468b8e23b1fb79416aa7b26706a101bb (patch) | |
tree | e24d07095c02d5061660d319a893abec0951a2a0 /net-analyzer/ntop/files/ntop-update-geoip-db | |
parent | Sparc stable, Bug #259360 --- looks fine. (diff) | |
download | gentoo-2-12eb56b9468b8e23b1fb79416aa7b26706a101bb.tar.gz gentoo-2-12eb56b9468b8e23b1fb79416aa7b26706a101bb.tar.bz2 gentoo-2-12eb56b9468b8e23b1fb79416aa7b26706a101bb.zip |
Update GeoIP databases through a cron job (#259394).
(Portage version: 2.1.6.4/cvs/Linux 2.6.25-gentoo-r6 x86_64)
Diffstat (limited to 'net-analyzer/ntop/files/ntop-update-geoip-db')
-rw-r--r-- | net-analyzer/ntop/files/ntop-update-geoip-db | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/net-analyzer/ntop/files/ntop-update-geoip-db b/net-analyzer/ntop/files/ntop-update-geoip-db new file mode 100644 index 000000000000..40d08189fe13 --- /dev/null +++ b/net-analyzer/ntop/files/ntop-update-geoip-db @@ -0,0 +1,21 @@ +#!/bin/sh + +BASE_URL=http://geolite.maxmind.com/download/geoip/database + +echo "Updating NTOP GeoIP databases..." + +cd /var/lib/ntop || exit + +for u in asnum/GeoIPASNum.dat.gz GeoLiteCity.dat.gz ; do + FILE_GZ=${u#*/} + FILE=${FILE_GZ%.gz} + wget -O ${FILE_GZ} ${BASE_URL}/${u} && + gunzip < ${FILE_GZ} > .${FILE} && + mv -f .${FILE} ${FILE} && + rm -f ${FILE_GZ} || + exit +done + +/etc/init.d/ntop --quiet status && /etc/init.d/ntop restart + +echo "NTOP GeoIP databases were successfully updated" |