]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - etc/rc.d/ypserv
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / etc / rc.d / ypserv
1 #!/bin/sh
2 #
3 # $FreeBSD$
4 #
5
6 # PROVIDE: ypserv
7 # REQUIRE: rpcbind
8 # KEYWORD: shutdown
9
10 . /etc/rc.subr
11
12 name="ypserv"
13 rcvar="nis_server_enable"
14 command="/usr/sbin/${name}"
15 start_precmd="ypserv_prestart"
16
17 load_rc_config $name
18 command_args="${nis_server_flags}"
19
20 ypserv_prestart()
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         _domain=`domainname`
30         if [ -z "$_domain" ]; then
31                 warn "NIS domainname(1) is not set."
32                 return 1
33         fi
34         if [ ! -d /var/yp/$_domain/. ]; then
35                 warn "/var/yp/$_domain is not a directory."
36                 return 1
37         fi
38 }
39
40 run_rc_command "$1"