#!/sbin/sh
#@(#)HP X Station Admin Scripts
#
# getuipaddr	Get IP address of X station from the user
#

while [ 0 ] 
do
  	$ECHO "Enter the IP address of the X station in dot notation, [q|?] : $NL"  
	read IPADDR
	case $IPADDR in
	    q)
		exit 1
		;;
	   \?)
		echo ""
		echo "You must assign your X station an IP address in order to continue."
		echo "An example of a valid IP address is 15.43.4.7"
		echo "Choose an IP address in the range allocated to your network."
		echo ""
		continue
		echo "Format error in IP address, "
		echo "an example of a valid address is 15.23.4.7  - please re-try!" 
		;;
	esac

	echo $IPADDR | egrep '^[0-9]+\.[0-9]+.[0-9]+.[0-9]+$' > /dev/null
	if [ $? -eq 0 ]
	then
		break
	fi
done

echo $IPADDR	> $TMP/IPADDR
exit 0
