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