#!/sbin/sh -
# $Id: vxnm-vxnetd.sh,v 1.7.65.5 2002/08/14 15:19:14 davidl Exp $
#ident "$Source: /project/unixvm-cvs/src/sol/cmd/vxvm/init.d/vxnm-vxnetd.sh,v $"

# Copyright (c) 2001 VERITAS Software Corporation.  ALL RIGHTS RESERVED.
# UNPUBLISHED -- RIGHTS RESERVED UNDER THE COPYRIGHT
# LAWS OF THE UNITED STATES.  USE OF A COPYRIGHT NOTICE
# IS PRECAUTIONARY ONLY AND DOES NOT IMPLY PUBLICATION
# OR DISCLOSURE.
# 
# THIS SOFTWARE CONTAINS CONFIDENTIAL INFORMATION AND
# TRADE SECRETS OF VERITAS SOFTWARE.  USE, DISCLOSURE,
# OR REPRODUCTION IS PROHIBITED WITHOUT THE PRIOR
# EXPRESS WRITTEN PERMISSION OF VERITAS SOFTWARE.
# 
#               RESTRICTED RIGHTS LEGEND
# USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT IS
# SUBJECT TO RESTRICTIONS AS SET FORTH IN SUBPARAGRAPH
# (C) (1) (ii) OF THE RIGHTS IN TECHNICAL DATA AND
# COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013.
#               VERITAS SOFTWARE
# 1600 PLYMOUTH STREET, MOUNTAIN VIEW, CA 94043

PATH=/usr/lib/vxvm/bin/:$PATH

# Set the locale information for message localization. This
# function can be used at boot time or called by other
# commands in user space (such as vxinstall.) At boot time
# we do not want localized messages, so we check for an
# environment variable to see when we are called. The variable
# will not exist at boot time.

OLC_MESSAGES=LC_MESSAGES
export OLC_MESSAGES
if [ $L10N_CMD ]
then
	#  L10N_CMD exists and is set to require localized
	#  messages.

	if [ $L10N_CMD = 1 ]
	then

		LC_MESSAGES=C
		export LC_MESSAGES
	fi
else

	#  L10N_CMD does not exist (or could be set to NULL)
	#  Assume we are booting the system and no localized
	#  messages are required.

	LC_MESSAGES=C
	export LC_MESSAGES
fi


/sbin/vxlictest -n "VERITAS Volume Manager" -f "VVR" >/dev/null 2>&1
if [ $? != 0 ]
then
	/sbin/vxlictest -n "VERITAS Volume Manager" -f "SRVM" >/dev/null 2>&1
	if [ $? != 0 ]
	then
		exit 1
	fi
fi

if [ ! -d /usr/sbin ]
then                    # /usr not mounted
        egettxt "/usr not mounted" vxvmshm:1469
        exit
fi

if [ -f "/etc/vx/reconfig.d/state.d/install-db" ]
then
	egettxt "vxvm installation not complete - vxnetd not started" vxvmshm:1478
	exit
fi

case "$1" in
'start'|'')
        /usr/sbin/vxnetd
        ;;
'stop')
        ;;
*)
        egettxt "Usage: /usr/sbin/vxnetd [port]" vxvmshm:1475
        ;;
esac
