#! /sbin/sh
# configure script
# $Revision: 1.2.114.1 $
#
# (c) Copyright Hewlett-Packard Company 1993
#
########

if [ -f /usr/lbin/sw/control_utils ];then
	. /usr/lbin/sw/control_utils
else
	echo "ERROR:    Cannot find /usr/lbin/sw/control_utils";exit 1
fi

if [ ! -f /etc/rc.config.d/nfsconf ];then
        echo "ERROR:	Can not find /etc/rc.config.d/nfsconf";	exit 1
fi
# Configure NFS_CLIENT to be 1 in nfsconf file.
#
ch_rc -a -p NFS_CLIENT=1 /etc/rc.config.d/nfsconf
echo "NOTE:    NFS_CLIENT in /etc/rc.config.d/nfsconf is now set to 1."

#=========
#   Copy a default file into place if it doesn't exits on the users 
#   file system.
#=========
function new_stuff {
newconfig_cp $1;errors_cp=$?
newconfig_msgs $errors_cp;errors_msgs=$?
if [ $errors_msgs -ne 0 ]; then errors_found=1;fi
}

errors_found=0
new_stuff	"/etc/netgroup"
new_stuff	"/etc/rpc"
new_stuff	"/etc/vhe_list"


# mv /etc/auto.master to /etc/auto_master
if [ -f /etc/auto.master ];then
	if [ ! -f /etc/auto_master];then
		ch_rc -a -p AUTO_MASTER='"/etc/auto_master"' /etc/rc.config.d/nfsconf
		mv /etc/auto.master /etc/auto_master
	fi
fi

# Add nfs to configuration file so that new kernel will be built.
#
if [[ -n $SW_DEFERRED_KERNBLD ]];then
	mod_systemfile ${SW_SYSTEM_FILE_PATH} -a nfs
	retval=$?
	if [[ $retval -ne $SUCCESS ]];then
		echo "ERROR:  Could not enter "nfs" in the ${SW_SYSTEM_FILE_PATH}"
		exit $retval
	fi
fi

if [ $errors_found -ne 0 ]; then
	exit $errors_found
else
	exit 0
fi

