]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - etc/rc.d/ypserv
Align the script more with rc.d/cleanvar (which doesn't output any
[FreeBSD/FreeBSD.git] / etc / rc.d / ypserv
1 #!/bin/sh
2 #
3 # $FreeBSD$
4 #
5
6 # PROVIDE: ypserv
7 # REQUIRE: rpcbind
8
9 . /etc/rc.subr
10
11 name="ypserv"
12 rcvar="nis_server_enable"
13 command="/usr/sbin/${name}"
14 start_precmd="ypserv_prestart"
15
16 load_rc_config $name
17 command_args="${nis_server_flags}"
18
19 ypserv_prestart()
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         _domain=`domainname`
29         if [ -z "$_domain" ]; then
30                 warn "NIS domainname(1) is not set."
31                 return 1
32         fi
33         if [ ! -d /var/yp/$_domain/. ]; then
34                 warn "/var/yp/$_domain is not a directory."
35                 return 1
36         fi
37 }
38
39 run_rc_command "$1"