# /bin/csh -f
set path = ($ADM_DIR $ADM_DIR/bin /bin /usr/bin /etc)

set noglob

while ( 1 )
	echo ""
	echo ""
	echo -n "Enter hostname for this system ('x' to abort admin, '?' for help)..."
	set ANS = `get_resp`
	if ( $ANS == "_HELP_" ) then
		adm_help HOSTNAME
		continue
	endif

	if ( $ANS == x || $ANS == X ) \
		exit(1)

	validate HOSTNAME $ANS
	if ( $status != 0 ) then
		echo "Selected name is not valid - please try again or type"
		echo "'?' for help.
		continue
	endif

	NameInUse $ANS
	if ( $status == 0 ) then
		continue
	else
		echo $ANS > $ADM_DIR/tmp/hostname
		exit(0)
	endif
end
#
# how did we get here?
#
echo "OOPS - broke out of loop in $0"
exit(1)
