#
# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
#ident	"@(#)preinstall	1.2	04/09/29 SMI"

if [ "$UPDATE" = yes ]; then

	#
	# If we are upgrading a system with smf(5) already present, then
	# we won't take any action.  Otherwise, if the NIS server was
	# enabled, preserve that state.
	#
	BASEPREFIX=`echo $BASEDIR | sed "s/\//_/g"`

	FILENAME=`echo sunwnisr_nis"$BASEPREFIX" | cut -c 1-256`
	TMPFILE=/tmp/$FILENAME
	if [ -f $TMPFILE ]; then
		rm $TMPFILE
	fi

	if [ ! -f $BASEDIR/var/svc/manifest/network/nis/server.xml ]; then
		domain=`cat $BASEDIR/etc/defaultdomain`
		if [ ! -z "$domain" -a -d $BASEDIR/var/yp/$domain ]; then
			touch $TMPFILE
		fi
	fi

fi

exit 0
