]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - etc/rc.d/ypset
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / etc / rc.d / ypset
1 #!/bin/sh
2 #
3 # $FreeBSD$
4 #
5
6 # PROVIDE: ypset
7 # REQUIRE: ypbind
8 # KEYWORD: shutdown
9
10 . /etc/rc.subr
11
12 name="ypset"
13 rcvar="nis_ypset_enable"
14 command="/usr/sbin/${name}"
15 start_precmd="ypset_precmd"
16 load_rc_config $name
17 command_args="${nis_ypset_flags}"
18
19 ypset_precmd()
20 {
21         local _domain
22
23         if ! checkyesno rpcbind_enable  && \
24             ! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1
25         then
26                 force_depend rpcbind || return 1
27         fi
28         if ! checkyesno nis_client_enable && \
29             ! /etc/rc.d/ypbind forcestatus 1>/dev/null 2>&1
30         then
31                 force_depend ypbind || return 1
32         fi
33
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"