From 6d260f6fcc07a1b0ae6b34a0c07d1668fcf08556 Mon Sep 17 00:00:00 2001 From: Leonardo Arena Date: Tue, 26 Oct 2010 09:40:33 +0000 Subject: testing/ntop: moved to main --- main/ntop/ntop-update-geoip-db | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 main/ntop/ntop-update-geoip-db (limited to 'main/ntop/ntop-update-geoip-db') diff --git a/main/ntop/ntop-update-geoip-db b/main/ntop/ntop-update-geoip-db new file mode 100644 index 0000000000..2bf3faaf68 --- /dev/null +++ b/main/ntop/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 -nv -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" -- cgit v1.2.3