diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2019-01-02 10:06:06 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2019-01-02 10:06:06 +0000 |
commit | 7c6239b112238719c308c1640f9cf50fcf44a148 (patch) | |
tree | 211cd3a4cb82eaaaae51d3ba900f6cbff0952c2a /unmaintained/ntopng/ntopng-update-geoip-db | |
parent | 8567007f74e878fb8abc7c43b0f887f4fda372b7 (diff) | |
download | aports-7c6239b112238719c308c1640f9cf50fcf44a148.tar.bz2 aports-7c6239b112238719c308c1640f9cf50fcf44a148.tar.xz |
testing/ntopng: move to unmaintained
Diffstat (limited to 'unmaintained/ntopng/ntopng-update-geoip-db')
-rw-r--r-- | unmaintained/ntopng/ntopng-update-geoip-db | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/unmaintained/ntopng/ntopng-update-geoip-db b/unmaintained/ntopng/ntopng-update-geoip-db new file mode 100644 index 0000000000..1ac05bc0e0 --- /dev/null +++ b/unmaintained/ntopng/ntopng-update-geoip-db @@ -0,0 +1,25 @@ +#!/bin/sh + +BASE_URL=http://geolite.maxmind.com/download/geoip/database + +echo "Updating NTOP GeoIP databases..." + +cd /usr/share/ntopng/geoip || exit + +for u in \ + asnum/GeoIPASNum.dat.gz \ + asnum/GeoIPASNumv6.dat.gz \ + GeoLiteCity.dat.gz \ + GeoLiteCityv6-beta/GeoLiteCityv6.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 + +rc-service ntopng status && rc-service ntopng restart + +echo "NTOP GeoIP databases were successfully updated" |