summaryrefslogtreecommitdiff
blob: 54dcd4fd948fee9787dc5722286bc308b7e9e300 (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
#!/sbin/runscript
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

depend() {
	need net
	use logger #@slapd@
}

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

	checkpath -d /var/run/dhcp

	local iface_opts
	if [ -n "${IFACE}" ] ; then
		iface_opts=$(printf -- '-i %s ' ${IFACE})
	fi

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

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