File ypbind-systemd-pre of Package ypbind

#!/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 

openSUSE Build Service is sponsored by