LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File ypbind-systemd-pre of Package ypbind (Project network)

#!/bin/sh
#
# ypbind-domain
#
# description: This is part of former ypbind init script, which is used 
#              to setup proper domainname before starting ypbind daemon 
#              itself.

mydomain=`domainname`
if [ "$mydomain" = "(none)" -o "x$mydomain" = "x" ]; then
	test -f /etc/defaultdomain && {
	    read DOMAINNAME < /etc/defaultdomain
	}

 	if [ "x$DOMAINNAME" != 'x' ]; then
 		echo "$DOMAINNAME\n"
 		domainname $DOMAINNAME
 	else
 		echo "\nError: NIS domain not specified.\n"
 		exit 1
 	fi
fi

## If we don't have a /etc/yp.conf file, skip starting of
## ypbind and return with "program not configured"
## if you add the -broadcast Option later, comment this out.
if [ ! -f /etc/yp.conf -a "$YPBIND_BROADCAST" != "yes" ] ; then
# Tell the user this has skipped
  echo -n " . . . . . . . . . . ${attn}/etc/yp.conf not found${norm}"
  exit 1
fi

# evaluate the OPTIONS for ypbind-mt
OTHER_YPBIND_OPTS=""
test "$YPBIND_VERBOSE" = "yes" && OTHER_YPBIND_OPTS="-verbose $OTHER_YPBIND_OPTS"
test "$YPBIND_LOCAL_ONLY" = "yes" && OTHER_YPBIND_OPTS="-local-only $OTHER_YPBIND_OPTS"
test "$YPBIND_BROADCAST" = "yes" && OTHER_YPBIND_OPTS="-broadcast $OTHER_YPBIND_OPTS"
test "$YPBIND_BROKEN_SERVER" = "yes" && OTHER_YPBIND_OPTS="-broken-server $OTHER_YPBIND_OPTS"
test "X$YPBIND_PING_INTERVAL" != "X" && OTHER_YPBIND_OPTS="-ping-interval $YPBIND_PING_INTERVAL $OTHER_YPBIND_OPTS"
test "$YPBIND_DBUS" = "no" && OTHER_YPBIND_OPTS="-no-dbus $OTHER_YPBIND_OPTS"
test -n "$YPBIND_OPTIONS" && OTHER_YPBIND_OPTS="$YPBIND_OPTIONS $OTHER_YPBIND_OPTS"

echo