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