#!/bin/ash # # client3: lookup-ip -- 2008-08-19 # # IP geolocation SSI client for ip2cn-server with errors to /dev/null # # Copyright (C) 2008 Grant Coady GPLv2 # /usr/bin/gawk -v qf="$1" ' BEGIN { ARGV[ARGC++] = "/etc/ip2cn-server.conf" } /^inetport/ { service = "/inet/tcp/0/localhost/" $2 } END { print ENVIRON["REMOTE_ADDR"] " " qf |& service service |& getline reply printf "%s", reply }' 2> /dev/null # end