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