1#!/bin/sh 2#
| 1#!/bin/sh 2#
|
3# $NetBSD: ypserv,v 1.4 2000/06/02 22:54:13 fvdl Exp $
| 3# $NetBSD: ypserv,v 1.5 2000/09/19 13:04:39 lukem Exp $ 4# $FreeBSD: head/etc/rc.d/ypserv 98184 2002-06-13 22:14:37Z gordon $
|
4# 5 6# PROVIDE: ypserv 7# REQUIRE: rpcbind
| 5# 6 7# PROVIDE: ypserv 8# REQUIRE: rpcbind
|
| 9# KEYWORD: FreeBSD NetBSD
|
8 9. /etc/rc.subr 10 11name="ypserv"
| 10 11. /etc/rc.subr 12 13name="ypserv"
|
12rcvar=$name
| |
13command="/usr/sbin/${name}"
| 14command="/usr/sbin/${name}"
|
14required_vars="rpcbind"
| |
15start_precmd="ypserv_precmd" 16
| 15start_precmd="ypserv_precmd" 16
|
| 17case `${CMD_OSTYPE}` in 18FreeBSD) 19 rcvar="nis_server_enable" 20 required_vars="portmap_enable" 21 command_args="${nis_server_flags}" 22 ;; 23NetBSD) 24 rcvar=${name} 25 required_vars="rpcbind" 26 ;; 27esac 28
|
17ypserv_precmd() 18{ 19 _domain=`domainname` 20 if [ -z "$_domain" ]; then 21 warn "domainname(1) is not set." 22 return 1 23 fi 24 25 if [ ! -d /var/yp/$_domain/. ]; then 26 warn "/var/yp/$_domain is not a directory." 27 return 1 28 fi 29} 30 31load_rc_config $name 32run_rc_command "$1"
| 29ypserv_precmd() 30{ 31 _domain=`domainname` 32 if [ -z "$_domain" ]; then 33 warn "domainname(1) is not set." 34 return 1 35 fi 36 37 if [ ! -d /var/yp/$_domain/. ]; then 38 warn "/var/yp/$_domain is not a directory." 39 return 1 40 fi 41} 42 43load_rc_config $name 44run_rc_command "$1"
|