mkinitrd - add tool and infrastructure for initrd
[dragonfly.git] / etc / rc.d / ypxfrd
CommitLineData
9c600e7d
MD
1#!/bin/sh
2#
3# $FreeBSD: src/etc/rc.d/ypxfrd,v 1.5 2003/07/09 03:21:03 mtm Exp $
696a5717 4# $DragonFly: src/etc/rc.d/ypxfrd,v 1.3 2005/11/19 21:47:32 swildner Exp $
9c600e7d
MD
5#
6
7# PROVIDE: ypxfrd
8# REQUIRE: rpcbind
9c600e7d
MD
9
10. /etc/rc.subr
11
12name="ypxfrd"
13rcvar="nis_ypxfrd_enable"
14command="/usr/sbin/rpc.${name}"
15start_precmd="ypxfrd_precmd"
16load_rc_config $name
17command_args="${nis_ypxfrd_flags}"
18
19ypxfrd_precmd()
20{
21 if ! checkyesno rpcbind_enable && \
22 ! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1
23 then
24 force_depend rpcbind || return 1
25 fi
26 if ! checkyesno nis_server_enable && \
27 ! /etc/rc.d/ypserv forcestatus 1>/dev/null 2>&1
28 then
29 force_depend ypserv || return 1
30 fi
31
32 _domain=`domainname`
33 if [ -z "$_domain" ]; then
34 warn "NIS domainname(1) is not set."
35 return 1
36 fi
37}
38
39run_rc_command "$1"