replace message if IP not found in GeoIP db
This commit is contained in:
parent
e8425f61bf
commit
0247f4c1fe
1 changed files with 1 additions and 0 deletions
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
for ip in $(cat /proc/net/xt_recent/DEFAULT | awk {'print $1'} | sed 's/src=//'); do
|
||||
IP=$(geoiplookup $ip | sed 's/GeoIP Country Edition:.*, //')
|
||||
if [[ "$IP" =~ "IP Address not found" ]]; then IP="n/a"; fi
|
||||
COUNT=$(cat /proc/net/xt_recent/DEFAULT | grep "$ip" | awk {'print $7'})
|
||||
echo -e "$COUNT\t$ip\t($IP)"
|
||||
done | sort -rn
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue