#!/sbin/sh
#
# @(#) $Revision: 72.10 $
#
# NOTE:    This script is not configurable!  Any changes made to this
#          scipt will be overwritten when you upgrade to the next
#          release of HP-UX.
#
# WARNING: Changing this script in any way may lead to a system that
#          is unbootable.  Do not modify this script.
#

#
# Set hostname
#

PATH=/sbin:/usr/sbin:/usr/bin
export PATH

rval=0
set_return() {
	x=$?
	if [ $x -ne 0 ]; then
		echo "EXIT CODE: $x"
		rval=1
	fi
}

case $1 in
start_msg)
	echo "Setting hostname"
	;;

start)
	if [ -f /etc/rc.config ] ; then
		. /etc/rc.config
	else
		echo "ERROR: /etc/rc.config defaults file MISSING"
	fi
	
	hostname $HOSTNAME
	set_return

	if [ -z "$NODENAME" ] ; then
	   uname -S ${HOSTNAME%%.*}
	else
	   uname -S $NODENAME
	fi
	set_return

        setuname -s $OPERATING_SYSTEM -t
        set_return
	;;

*)
	echo "usage: $0 {start}"
	;;
esac

exit $rval
