2012-07-14 11:18:59 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
#
|
2020-08-29 10:08:47 +00:00
|
|
|
# Setup proper domainname before starting ypbind daemon
|
2012-07-14 11:18:59 +00:00
|
|
|
#
|
|
|
|
|
|
2020-08-29 10:08:47 +00:00
|
|
|
mydomain=$(domainname)
|
|
|
|
|
if [ "$mydomain" = "(none)" ] || [ "x$mydomain" = "x" ]; then
|
2012-11-22 16:40:27 +00:00
|
|
|
test -f /etc/defaultdomain && {
|
|
|
|
|
read DOMAINNAME < /etc/defaultdomain
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if [ "x$DOMAINNAME" != 'x' ]; then
|
2020-08-29 10:08:47 +00:00
|
|
|
domainname "$DOMAINNAME"
|
2012-11-22 16:40:27 +00:00
|
|
|
else
|
2020-08-29 10:08:47 +00:00
|
|
|
echo "ERROR: NIS domain not specified." >&2
|
2012-11-22 16:40:27 +00:00
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
2020-01-29 14:46:54 +00:00
|
|
|
## If we don't have a yp.conf file, skip starting of
|
2012-07-14 11:18:59 +00:00
|
|
|
## ypbind and return with "program not configured"
|
2020-08-29 10:08:47 +00:00
|
|
|
if [ ! -f /etc/yp.conf ] && [ ! -f /run/netconfig/yp.conf ] ; then
|
2012-07-14 11:18:59 +00:00
|
|
|
# Tell the user this has skipped
|
2020-08-29 10:08:47 +00:00
|
|
|
echo " ERROR: yp.conf not found" >&2
|
2012-07-14 11:18:59 +00:00
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
echo
|
|
|
|
|
|