aboutsummaryrefslogtreecommitdiffstats
path: root/main/dhcp/dhcrelay.initd
blob: 1ad8d787de6f49ec2f9b9e39af1043e15f0cf05a (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
#!/sbin/openrc-run
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/files/dhcrelay.init,v 1.2 2007/03/22 15:36:59 uberlord Exp $

depend() {
	need net
	use logger
	after firewall
}

start() {
	if [ -z "${DHCRELAY_SERVERS}" ]; then
		eerror "No DHCRELAY_SERVERS specified in /etc/conf.d/dhcrelay"
		return 1
	fi

	local IFACES= i=
	for i in ${IFACE} ; do
		IFACES="${IFACES} -i ${i}"
	done

	ebegin "Starting dhcrelay"
	start-stop-daemon --start --exec /usr/sbin/dhcrelay \
		-- -q ${IFACES} ${DHCRELAY_OPTS} ${DHCRELAY_SERVERS}
	eend $?
}

stop() {
	ebegin "Stopping dhcrelay"
	start-stop-daemon --stop --pidfile /var/run/dhcp/dhcrelay.pid
	eend $?
}