xref: /freebsd/libexec/rc/rc.d/ypset (revision 517904de5ccac643589c71ac0d2751797f89e4f9)
1#!/bin/sh
2#
3# $FreeBSD$
4#
5
6# PROVIDE: ypset
7# REQUIRE: ypbind
8# KEYWORD: shutdown
9
10. /etc/rc.subr
11
12name="ypset"
13desc="tell ypbind(8) which YP server process to use"
14rcvar="nis_ypset_enable"
15
16load_rc_config $name
17
18command="/usr/sbin/${name}"
19command_args="${nis_ypset_flags}"
20
21start_precmd="ypset_precmd"
22
23ypset_precmd()
24{
25	local _domain
26
27	force_depend rpcbind || return 1
28	force_depend ypbind nis_client || return 1
29
30	_domain=`domainname`
31	if [ -z "$_domain" ]; then
32		warn "NIS domainname(1) is not set."
33		return 1
34	fi
35}
36
37run_rc_command "$1"
38