Blob Blame History Raw
#!/bin/sh
#
# ypbind-domain
#
# description: This is part of former ypbind init script, which is used 
#              to setup proper domainname before starting ypbind daemon 
#              itself. If $NISDOMAIN is not defined, it reads config file. 
#

OTHER_YPBIND_OPTS=""

DOMAINNAME=`domainname`
if [ "$DOMAINNAME" = "(none)" -o "$DOMAINNAME" = "" ]; then
    echo -n $"Setting NIS domain: "
    if [ -n "$NISDOMAIN" ]; then
	domainname $NISDOMAIN
	echo $"'$NISDOMAIN' (environment variable)"
    else # See if the domain is set in config file
	NISDOMAIN=`awk '{ if ($1 == "domain") {print $2; exit} }' /etc/yp.conf`
	if [ -n "$NISDOMAIN" ]; then
	    domainname $NISDOMAIN
	    echo $"'$NISDOMAIN' (/etc/yp.conf)"
	else
            logger -t ypbind $"domain not found"
            exit 1
        fi
    fi
fi

#/etc/rpc check
grep ypbind /etc/rpc > /dev/null 2>&1
if [ $? -ne 0 ]; then
    logger -t ypbind $"Error: Missing ypbind entry in /etc/rpc."
    exit 1
fi

echo