xref: /freebsd/libexec/rc/rc.d/ypserv (revision 5ca8e32633c4ffbbcd6762e5888b6a4ba0708c6c)
1#!/bin/sh
2#
3#
4
5# PROVIDE: ypserv
6# REQUIRE: rpcbind
7# KEYWORD: shutdown
8
9. /etc/rc.subr
10
11name="ypserv"
12desc="NIS database server"
13rcvar="nis_server_enable"
14
15load_rc_config $name
16
17command="/usr/sbin/${name}"
18command_args="${nis_server_flags}"
19
20start_precmd="ypserv_prestart"
21
22ypserv_prestart()
23{
24	local _domain
25
26	force_depend rpcbind || return 1
27
28	_domain=`domainname`
29	if [ -z "$_domain" ]; then
30		warn "NIS domainname(1) is not set."
31		return 1
32	fi
33	if [ ! -d /var/yp/$_domain/. ]; then
34		warn "/var/yp/$_domain is not a directory."
35		return 1
36	fi
37}
38
39run_rc_command "$1"
40