#!BOURNESHELL
#	program:	netwithzeros
#	input:		one (possibly partial) network address on command line,
#			consisting of dot-separated octets.
#	output:		four dot-separated octets representing the same net,
#			where zero octets are added to the right end if needed.
#	example:	"134.114" -> "134.114.0.0"
#	exit value:	0 if nothing goes wrong, 1 if something did.

AWK=DOMLIB/netwithzeros.awk

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

netzero=`echo $1 | awk -F. -f $AWK`
status=$?

if test $status -ne 0; then
	status=1
else
	echo $netzero
fi

if test $status -ne 0; then
	echo 'ERROR'
fi

exit $status
