xref: /dragonfly/etc/rc.d/ypset (revision 35e996c9)
1#!/bin/sh
2#
3# $FreeBSD: src/etc/rc.d/ypset,v 1.5 2003/07/09 03:21:03 mtm Exp $
4#
5
6# PROVIDE: ypset
7# REQUIRE: rpcbind ypbind
8
9. /etc/rc.subr
10
11name="ypset"
12rcvar="nis_ypset_enable"
13command="/usr/sbin/${name}"
14command_args="${nis_ypset_flags}"
15start_precmd="ypset_precmd"
16
17ypset_precmd()
18{
19	if ! checkyesno rpcbind_enable  && \
20	   ! /etc/rc.d/rpcbind forcestatus >/dev/null 2>&1
21	then
22		force_depend rpcbind || return 1
23	fi
24	if ! checkyesno nis_client_enable && \
25	   ! /etc/rc.d/ypbind forcestatus >/dev/null 2>&1
26	then
27		force_depend ypbind || return 1
28	fi
29
30	_domain=`domainname`
31	if [ -z "$_domain" ]; then
32		warn "NIS domainname(1) is not set."
33		return 1
34	fi
35}
36
37load_rc_config $name
38run_rc_command "$1"
39