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