Plan 9 from Bell Labs’s /usr/web/sources/contrib/steve/rc/ipinfo

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#!/bin/rc
#

rfork ne

for(ip in $*){
	hget 'http://api.geoiplookup.net/?query='^$ip |
		sed 's/></>\n</g' |
		sed -n 's/^<(.+)>(.+)<.+>$/\1 : \2/p' | 
		grep -v '^host'

	echo $ip | 
		ndb/dnsquery |
		awk '$3 == "ptr" {print "revdns", ":", $NF}'


	echo $ip |
		sed 's/([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/\4.\3.\2.\1.abuse-contacts.abusix.org txt/' |
		ndb/dnsquery |
		awk '$3 == "txt" {print "abusix", ":", $NF}'

} |
columns





Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.