#!/bin/sh # # rc.nis - Starts up NIS/NFS seemless integrated environment # Last modified 12-Dec-2000 by David Cantrell, # # NODETYPE # Set this to "client" to be a NIS/NFS client. Set this to "server" to # be the NIS/NFS server. NODETYPE="client" # USENFS # Set this to "yes" to use NFS. Set it to "no" to not use NFS. USENFS="yes" # USEAUTOFS # Set this to "yes" to use the automounter. Set it to "no" to not use it. USEAUTOFS="yes" ############################################################################# ### END USER-CONFIGURABLE SECTION ### ############################################################################# if [ "$NODETYPE" = "server" ] then # Set our NIS domain and fire up the three NIS server daemons if [ -f /etc/defaultdomain ] then /bin/nisdomainname `cat /etc/defaultdomain` fi echo -n "Starting NIS server:" if [ -x /usr/sbin/ypbind ] then /usr/sbin/ypbind echo -n " ypbind" fi if [ -x /usr/sbin/ypserv ] then /usr/sbin/ypserv echo -n " ypserv" fi if [ -x /usr/sbin/rpc.yppasswdd ] then /usr/sbin/rpc.yppasswdd -e chsh -e chfn echo -n " rpc.yppasswdd" fi if [ "$USENFS" = "yes" ] then # Make sure the NFS daemons are running if [ "`ps -e | grep rpc.portmap`" = "" ] then if [ -x /sbin/rpc.portmap ] then /sbin/rpc.portmap echo -n " rpc.portmap" fi fi if [ "`ps -e | grep rpc.mountd`" = "" ] then if [ -x /usr/sbin/rpc.mountd ] then /usr/sbin/rpc.mountd echo -n " rpc.mountd" fi fi if [ "`ps -e | grep rpc.nfsd`" = "" ] then if [ -x /usr/sbin/rpc.nfsd ] then /usr/sbin/rpc.nfsd echo -n " rpc.nfsd" fi fi fi echo # Get the automounter running if [ "$USEAUTOFS" = "yes" ] then if [ -x /etc/rc.d/rc.autofs ] then /etc/rc.d/rc.autofs fi fi elif [ "$NODETYPE" = "client" ] then # Set our NIS domain and fire up the ypbind daemon if [ -f /etc/defaultdomain ] then /bin/nisdomainname `cat /etc/defaultdomain` fi echo -n "Starting NIS server:" if [ -x /usr/sbin/ypbind ] then /usr/sbin/ypbind echo -n " ypbind" fi if [ "$USENFS" = "yes" ] then # Make sure the NFS daemons are running if [ "`ps -e | grep rpc.portmap`" = "" ] then if [ -x /sbin/rpc.portmap ] then /sbin/rpc.portmap echo -n " rpc.portmap" fi fi if [ "`ps -e | grep rpc.mountd`" = "" ] then if [ -x /usr/sbin/rpc.mountd ] then /usr/sbin/rpc.mountd echo -n " rpc.mountd" fi fi if [ "`ps -e | grep rpc.nfsd`" = "" ] then if [ -x /usr/sbin/rpc.nfsd ] then /usr/sbin/rpc.nfsd echo -n " rpc.nfsd" fi fi echo fi # Get the automounter running if [ "$USEAUTOFS" = "yes" ] then if [ -x /etc/rc.d/rc.autofs ] then /etc/rc.d/rc.autofs fi fi fi