]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - etc/rc.d/yppasswdd
o Convert whitespaces to tabs.
[FreeBSD/FreeBSD.git] / etc / rc.d / yppasswdd
1 #!/bin/sh
2 #
3 # $FreeBSD$
4 #
5
6 # PROVIDE: yppasswdd
7 # REQUIRE: ypserv ypbind
8 # BEFORE:  LOGIN
9
10 . /etc/rc.subr
11
12 name="yppasswdd"
13 command="/usr/sbin/rpc.${name}"
14 start_precmd="yppasswdd_precmd"
15
16 load_rc_config $name
17 rcvar="nis_yppasswdd_enable"
18 command_args="${nis_yppasswdd_flags}"
19
20 yppasswdd_precmd()
21 {
22         local _domain
23
24         if ! checkyesno rpcbind_enable  && \
25             ! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1
26         then
27                 force_depend rpcbind || return 1
28         fi
29         if ! checkyesno nis_server_enable && \
30             ! /etc/rc.d/ypserv forcestatus 1>/dev/null 2>&1
31         then
32                 force_depend ypserv || return 1
33         fi
34         _domain=`domainname`
35         if [ -z "$_domain" ]; then
36                 warn "NIS domainname(1) is not set."
37                 return 1
38         fi
39 }
40
41 run_rc_command "$1"