Blame SOURCES/ypbind-pre-setdomain

5a592e
#!/bin/sh
5a592e
#
5a592e
# ypbind-domain
5a592e
#
5a592e
# description: This is part of former ypbind init script, which is used 
5a592e
#              to setup proper domainname before starting ypbind daemon 
5a592e
#              itself. If $NISDOMAIN is not defined, it reads config file. 
5a592e
#
5a592e
5a592e
OTHER_YPBIND_OPTS=""
5a592e
5a592e
DOMAINNAME=`domainname`
5a592e
if [ "$DOMAINNAME" = "(none)" -o "$DOMAINNAME" = "" ]; then
5a592e
    echo -n $"Setting NIS domain: "
5a592e
    if [ -n "$NISDOMAIN" ]; then
5a592e
	domainname $NISDOMAIN
5a592e
	echo $"'$NISDOMAIN' (environment variable)"
5a592e
    else # See if the domain is set in config file
5a592e
	NISDOMAIN=`awk '{ if ($1 == "domain") {print $2; exit} }' /etc/yp.conf`
5a592e
	if [ -n "$NISDOMAIN" ]; then
5a592e
	    domainname $NISDOMAIN
5a592e
	    echo $"'$NISDOMAIN' (/etc/yp.conf)"
5a592e
	else
5a592e
            logger -t ypbind $"domain not found"
5a592e
            exit 1
5a592e
        fi
5a592e
    fi
5a592e
fi
5a592e
5a592e
#/etc/rpc check
5a592e
grep ypbind /etc/rpc > /dev/null 2>&1
5a592e
if [ $? -ne 0 ]; then
5a592e
    logger -t ypbind $"Error: Missing ypbind entry in /etc/rpc."
5a592e
    exit 1
5a592e
fi
5a592e
5a592e
echo 
5a592e