xref: /dflybsd-src/etc/rc.d/ypset (revision c726e452248520050b4ff9cc6b75b0d737527ed2)
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}"
14start_precmd="ypset_precmd"
15
16ypset_precmd()
17{
18	if ! checkyesno rpcbind_enable  && \
19	   ! /etc/rc.d/rpcbind forcestatus >/dev/null 2>&1
20	then
21		force_depend rpcbind || return 1
22	fi
23	if ! checkyesno nis_client_enable && \
24	   ! /etc/rc.d/ypbind forcestatus >/dev/null 2>&1
25	then
26		force_depend ypbind || return 1
27	fi
28
29	_domain=`domainname`
30	if [ -z "$_domain" ]; then
31		warn "NIS domainname(1) is not set."
32		return 1
33	fi
34}
35
36load_rc_config $name
37command_args="${nis_ypset_flags}"
38
39run_rc_command "$1"
40