[BACK]Return to ypserv CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / etc / rc.d

File: [cvs.NetBSD.org] / src / etc / rc.d / ypserv (download)

Revision 1.2, Thu Mar 16 22:22:15 2000 UTC (19 years, 7 months ago) by lukem
Branch: MAIN
Changes since 1.1: +6 -5 lines

fix check for domainname since it can come from /etc/defaultdomain as well as $domainname

#!/bin/sh
#
# $NetBSD: ypserv,v 1.2 2000/03/16 22:22:15 lukem Exp $
#

# PROVIDE: ypserv
# REQUIRE: portmap

. /etc/rc.subr
. /etc/rc.conf

name="ypserv"
command="/usr/sbin/${name}"
required_vars="portmap"
start_precmd="ypserv_precmd"

ypserv_precmd()
{
	_domain=`domainname`
	if [ -z "$_domain" ]; then
		warn "domainname(1) is not set; ${name} not started"
		return 1
	fi

	if [ ! -d /var/yp/$_domain/. ]; then
		warn "/var/yp/$_domain is not a directory; ${name} not started"
		return 1
	fi
}

run_rc_command "$1"