ypserv/ypserv-pre-setdomain

22 lines
580 B
Bash

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