9482c4
#!/bin/sh
9482c4
#
9482c4
# yppasswdd-pre-setdomain
9482c4
#
9482c4
# description: This is part of former ypserv init script, which is used 
9482c4
#              to setup proper domainname before starting yppasswdd daemon
9482c4
#              itself. If $NISDOMAIN is not defined, it fails. 
9482c4
#
9482c4
9482c4
DOMAINNAME=`domainname`
9482c4
if [ "$DOMAINNAME" = "(none)" -o "$DOMAINNAME" = "" ]; then
9482c4
    echo -n $"Setting NIS domain: "
9482c4
    if [ -n "$NISDOMAIN" ]; then
9482c4
        domainname $NISDOMAIN
9482c4
        echo $"'$NISDOMAIN' (environment variable)"
9482c4
    else # no domainname found
9482c4
        logger -t yppasswdd $"domain not found"
9482c4
        exit 1
9482c4
    fi
9482c4
fi
9482c4