+# Auth info
+/^\.auth/ {
+ _who = $2 ? $2 : FROM
+ if (_who in USERS)
+ say("nick=" USERS[_who]["nick"] " " \
+ "user=" USERS[_who]["user"] " " \
+ "auth=" USERS[_who]["auth"] " " \
+ "real=" USERS[_who]["real"] " " \
+ "host=" USERS[_who]["host"])
+ else
+ say("no auth info for " _who)
+}
+
+# GeoIP Lookup
+function geoip(ip, dat, cmd, line, parts) {
+ dat = "/usr/share/GeoIP/GeoIPCity.dat"
+
+ cmd = "geoiplookup -f " dat " " ip
+ cmd | getline line
+ close(cmd)
+
+ if (split(line, parts, /[:,] /) >= 9)
+ return parts[8] "," parts[9] " -- " \
+ parts[6] ", " parts[4] ", " parts[3]
+ else
+ return "not found"
+}
+
+/^\.geoip (([0-9a-zA-Z_.-]+) *)*$/ {
+ for (_i=2; _i<=NF; _i++) {
+ if ($_i in USERS)
+ say(geoip(USERS[$_i]["host"]) " -- " \
+ $_i " -> " USERS[$_i]["host"])
+ else
+ say(geoip($_i) " -- " $_i)
+ }
+}
+