1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-26 04:35:39 +03:00
aports/testing/ntopng/ntopng-update-geoip-db
Leonardo Arena fe8c11c195 testing/ntopng: new aport
High-speed web-based traffic analysis and flow collection.

It's Ntop next-generation software
2015-07-27 07:42:47 +00:00

25 lines
569 B
Bash

#!/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"