From 8561ebc1e686882f1e8192130c8f828679873c6f Mon Sep 17 00:00:00 2001 From: Knah Tsaeb Date: Fri, 3 Jul 2015 16:18:06 +0200 Subject: [PATCH] [add] if geoIP.dat exist use it --- bin/bancountmysql | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/bancountmysql b/bin/bancountmysql index bc1d506..a8ff158 100755 --- a/bin/bancountmysql +++ b/bin/bancountmysql @@ -8,7 +8,12 @@ curDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)" source $curDir/bancount.cfg -allInfoIp=`geoiplookup $ip`; +if [ -f GeopIP.dat] + then + allInfoIp=`geoiplookup $ip`; + else + allInfoIp=`geoiplookup -f GeopIP.dat $ip`; + fi geoip () { echo $allInfoIp | awk -F, '{print $2}' | sed s/\ //