#
# domaintable: generate rules to use domaintable facility
#

REVISION_ID='@(#)domaintable	3.5 (motonori/WIDE) 2/26/94'

#|# use domaintable feature (yes/no/"database path"; default:/etc/domaintable)
#|# how to make DB: makemap hash /etc/domaintable.db < /etc/domaintable
#|#DOMAINTABLE=no

: ${DOMAINTABLE=no}
if [ "$DOMAINTABLE" != no ]
then

	if [ "$REVISION_ID_LIST" ]
	then
		REVISION_ID_LIST="$REVISION_ID_LIST\\
# $REVISION_ID"
	else
		REVISION_ID_LIST="# $REVISION_ID"
	fi

case "$DOMAINTABLE" in
/*) DOMAINTABLEDB="$DOMAINTABLE";;
*)  DOMAINTABLEDB="/etc/domaintable";;
esac

HDRDOMAINTABLE="\\
# domain table (adding domains)\\
Kdomaintable hash -o $DOMAINTABLEDB"

DOMAINTABLERULE='\
# look up unqualified domains in the domain table\
R$*<@$->$*		$:$1<@$(domaintable $2 $)>$3\
R$*<@$-.UUCP>$*		$:$1<@$(domaintable $2 $: $2.UUCP $)>$3'

fi
