smeserver-xt_geoip/source/root/usr/share/xt_geoip/geoip_look

12 lines
230 B
Plaintext
Raw Normal View History

2023-02-06 20:04:43 +01:00
#! /bin/bash
for par in "$@"
do
CN=$(/usr/bin/mmdblookup --file /usr/share/GeoIP/GeoLite2-Country.mmdb --ip $par country iso_code 2>/dev/null | cut -d\" -f2| tr -d '\n')
if [ -z $CN ]; then echo 'XX'; else echo $CN; fi
done