yppasswdd revision 117346
1#!/bin/sh
2#
3# $NetBSD: yppasswdd,v 1.6 2002/03/22 04:34:01 thorpej Exp $
4# $FreeBSD: head/etc/rc.d/yppasswdd 117346 2003-07-09 03:21:03Z mtm $
5#
6
7# PROVIDE: yppasswdd
8# REQUIRE: ypserv ypbind
9# BEFORE:  LOGIN
10# KEYWORD: FreeBSD NetBSD
11
12. /etc/rc.subr
13
14name="yppasswdd"
15command="/usr/sbin/rpc.${name}"
16start_precmd="yppasswdd_precmd"
17
18load_rc_config $name
19case ${OSTYPE} in
20FreeBSD)
21	rcvar="nis_yppasswdd_enable"
22	command_args="${nis_yppasswdd_flags}"
23	;;
24NetBSD)
25	rcvar=$name
26	required_vars="rpcbind ypserv"
27	;;
28esac
29
30yppasswdd_precmd()
31{
32	case ${OSTYPE} in
33	FreeBSD)
34		if ! checkyesno rpcbind_enable  && \
35		    ! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1
36		then
37			force_depend rpcbind || return 1
38		fi
39		if ! checkyesno nis_server_enable && \
40		    ! /etc/rc.d/ypserv forcestatus 1>/dev/null 2>&1
41		then
42			force_depend ypserv || return 1
43		fi
44		;;
45	esac
46
47	_domain=`domainname`
48	if [ -z "$_domain" ]; then
49		warn "NIS domainname(1) is not set."
50		return 1
51	fi
52}
53
54run_rc_command "$1"
55