forked from pool/ypbind
- Cleanup ypbind-systemd-pre OBS-URL: https://build.opensuse.org/package/show/network:NIS/ypbind?expand=0&rev=28
30 lines
636 B
Bash
30 lines
636 B
Bash
#!/bin/sh
|
|
#
|
|
# Setup proper domainname before starting ypbind daemon
|
|
#
|
|
|
|
mydomain=$(domainname)
|
|
if [ "$mydomain" = "(none)" ] || [ "x$mydomain" = "x" ]; then
|
|
test -f /etc/defaultdomain && {
|
|
read DOMAINNAME < /etc/defaultdomain
|
|
}
|
|
|
|
if [ "x$DOMAINNAME" != 'x' ]; then
|
|
domainname "$DOMAINNAME"
|
|
else
|
|
echo "ERROR: NIS domain not specified." >&2
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
## If we don't have a yp.conf file, skip starting of
|
|
## ypbind and return with "program not configured"
|
|
if [ ! -f /etc/yp.conf ] && [ ! -f /run/netconfig/yp.conf ] ; then
|
|
# Tell the user this has skipped
|
|
echo " ERROR: yp.conf not found" >&2
|
|
exit 1
|
|
fi
|
|
|
|
echo
|
|
|