freebsd-nq/etc/rc.d/ypserv
Gordon Tetlow 27bc1b287e Merge in all the changes that Mike Makonnen has been maintaining for a
while. This is only the script pieces, the glue for the build comes next.

Submitted by:	Mike Makonnen <makonnen@pacbell.net>
Reviewed by:	silence on -current and -hackers
Prodded by:	rwatson
2002-06-13 22:14:37 +00:00

45 lines
687 B
Bash
Executable File

#!/bin/sh
#
# $NetBSD: ypserv,v 1.5 2000/09/19 13:04:39 lukem Exp $
# $FreeBSD$
#
# PROVIDE: ypserv
# REQUIRE: rpcbind
# KEYWORD: FreeBSD NetBSD
. /etc/rc.subr
name="ypserv"
command="/usr/sbin/${name}"
start_precmd="ypserv_precmd"
case `${CMD_OSTYPE}` in
FreeBSD)
rcvar="nis_server_enable"
required_vars="portmap_enable"
command_args="${nis_server_flags}"
;;
NetBSD)
rcvar=${name}
required_vars="rpcbind"
;;
esac
ypserv_precmd()
{
_domain=`domainname`
if [ -z "$_domain" ]; then
warn "domainname(1) is not set."
return 1
fi
if [ ! -d /var/yp/$_domain/. ]; then
warn "/var/yp/$_domain is not a directory."
return 1
fi
}
load_rc_config $name
run_rc_command "$1"