27bc1b287e
while. This is only the script pieces, the glue for the build comes next. Submitted by: Mike Makonnen <makonnen@pacbell.net> Reviewed by: silence on -current and -hackers Prodded by: rwatson
45 lines
687 B
Bash
Executable File
45 lines
687 B
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# $NetBSD: ypserv,v 1.5 2000/09/19 13:04:39 lukem Exp $
|
|
# $FreeBSD$
|
|
#
|
|
|
|
# PROVIDE: ypserv
|
|
# REQUIRE: rpcbind
|
|
# KEYWORD: FreeBSD NetBSD
|
|
|
|
. /etc/rc.subr
|
|
|
|
name="ypserv"
|
|
command="/usr/sbin/${name}"
|
|
start_precmd="ypserv_precmd"
|
|
|
|
case `${CMD_OSTYPE}` in
|
|
FreeBSD)
|
|
rcvar="nis_server_enable"
|
|
required_vars="portmap_enable"
|
|
command_args="${nis_server_flags}"
|
|
;;
|
|
NetBSD)
|
|
rcvar=${name}
|
|
required_vars="rpcbind"
|
|
;;
|
|
esac
|
|
|
|
ypserv_precmd()
|
|
{
|
|
_domain=`domainname`
|
|
if [ -z "$_domain" ]; then
|
|
warn "domainname(1) is not set."
|
|
return 1
|
|
fi
|
|
|
|
if [ ! -d /var/yp/$_domain/. ]; then
|
|
warn "/var/yp/$_domain is not a directory."
|
|
return 1
|
|
fi
|
|
}
|
|
|
|
load_rc_config $name
|
|
run_rc_command "$1"
|