summaryrefslogtreecommitdiff
blob: ab4ad4f59c914809d5904b4cd91d63389e428ad0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/sbin/runscript
# Copyright 2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-usbin/files/rarpd.initd,v 1.2 2006/11/20 12:37:43 flameeyes Exp $

depend() {
	if [[ -z ${RARPD_ONLY_INTERFACE} ]]; then
		need net
	else
		need net."${RARPD_ONLY_INTERFACE}"
	fi
}

start() {
	local rarpd_opts

	if [[ -z ${RARPD_ONLY_INTERFACE} ]]; then
		rarpd_opts="${rarpd_opts} -a"
	else
		rarpd_opts="${rarpd_opts} ${RARPD_ONLY_INTERFACE}"
	fi

	ebegin "Starting reverse ARP daemon"
	start-stop-daemon --start --background \
		--pidfile /var/run/rarpd.pid --make-pidfile \
		--exec /usr/sbin/rarpd -- -f ${rarpd_opts}
	eend $?
}

stop() {
	ebegin "Stopping reverse ARP daemon"
	start-stop-daemon --stop --pidfile /var/run/rarpd.pid \
		--exec /usr/sbin/rarpd -- ${rarpd_opts}
	eend $?
}