xref: /dragonfly/etc/rc.d/ypset (revision 9bb2a92d)
1#!/bin/sh
2#
3# $FreeBSD: src/etc/rc.d/ypset,v 1.5 2003/07/09 03:21:03 mtm Exp $
4# $DragonFly: src/etc/rc.d/ypset,v 1.2 2004/01/27 00:55:43 rob Exp $
5#
6
7# PROVIDE: ypset
8# REQUIRE: ypbind
9# KEYWORD: DragonFly
10
11. /etc/rc.subr
12
13name="ypset"
14rcvar="nis_ypset_enable"
15command="/usr/sbin/${name}"
16start_precmd="ypset_precmd"
17load_rc_config $name
18command_args="${nis_ypset_flags}"
19
20ypset_precmd()
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