#!/sbin/sh
#
# @(#) $Revision: 72.9 $
#
# 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.
#

#
# Comment
#

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 "Enable SwitchOver/UX product"
	;;

stop_msg)
	# ????
	;;

'start')
	if [ -f /etc/rc.config ] ; then
		. /etc/rc.config
	else
		echo "ERROR: /etc/rc.config defaults file MISSING"
	fi
	# This whole subsystem needs to be restructured to put configuration
	# info into /etc and scripts and cmds in /usr/sbin/switch

	# rval=2;break; remove this line after fixes have been applied

        if [ -x /usr/sbin/switch/switchsetlan ]; then
            SWITCH_INFO="${SWITCH_INFO:-/etc/switch/Switchinfo}"
            if [ $HOSTNAME != "unknown" ]; then
                if [ -f $SWITCH_INFO ]; then
                    /usr/sbin/switch/switchsetlan -f $SWITCH_INFO $HOSTNAME
                else
                    echo "SwitchOver/UX: The SwitchOver product has been installed,\n but the SwitchOver configuration file, $SWITCH_INFO, is not present."
                fi
            else
                echo "SwitchOver/UX: The SwitchOver product has been installed,\n but \$HOSTNAME has been set to $HOSTNAME"
            fi
        fi

	;;

'stop')
	# Is there anything to stop???
	;;

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

