#!BOURNESHELL
#	program:	f2iaddr
#	input:		one network address on the command line, consisting of
#			dot-separated octets or words.
#	output:		the inverse address domain name of the address is sent
#			to stdout, or "ERROR" to stdout if problem occurs.
#			Usage printed to stderr, too, if usage error occurs.
#	example:	"134.114.64.24" -> "24.64.114.134.in-addr.arpa."
#	exit value:	0 if nothing goes wrong, 1 if something did.

AWK=DOMLIB/f2iaddr.awk

if test $# -ne 1; then
	echo "usage: $0 ipaddress" >&2
	echo 'ERROR'
	exit 1
fi

echo $1 | awk -f $AWK
status=$?
if test $status -ne 0; then
	echo 'ERROR'
	exit 1
fi

exit $status
