[add] if geoIP.dat exist use it

This commit is contained in:
Knah Tsaeb 2015-07-03 16:18:06 +02:00
parent 94f61fcdc6
commit 8561ebc1e6
1 changed files with 6 additions and 1 deletions

View File

@ -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/\ //