2016-05-18 11:44:22 +03:00
|
|
|
#!/sbin/openrc-run
|
2012-05-16 14:32:29 +04:00
|
|
|
# Copyright 1999-2012 Gentoo Foundation
|
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
|
|
|
|
depend() {
|
|
|
|
need net
|
2012-11-12 09:10:25 +04:00
|
|
|
use logger #@slapd@
|
2012-05-16 14:32:29 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
start() {
|
2012-05-17 09:57:23 +04:00
|
|
|
if [ -z "${DHCRELAY_SERVERS}" ] ; then
|
2012-05-16 14:32:29 +04:00
|
|
|
eerror "No DHCRELAY_SERVERS specified in /etc/conf.d/${SVCNAME}"
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
checkpath -d /var/run/dhcp
|
|
|
|
|
2012-05-17 09:57:23 +04:00
|
|
|
local iface_opts
|
|
|
|
if [ -n "${IFACE}" ] ; then
|
|
|
|
iface_opts=$(printf -- '-i %s ' ${IFACE})
|
|
|
|
fi
|
|
|
|
|
2012-05-16 14:32:29 +04:00
|
|
|
ebegin "Starting ${SVCNAME}"
|
|
|
|
start-stop-daemon --start --exec /usr/sbin/dhcrelay \
|
2012-05-17 09:57:23 +04:00
|
|
|
-- -q ${iface_opts} ${DHCRELAY_OPTS} ${DHCRELAY_SERVERS}
|
2012-05-16 14:32:29 +04:00
|
|
|
eend $?
|
|
|
|
}
|
|
|
|
|
|
|
|
stop() {
|
|
|
|
ebegin "Stopping ${SVCNAME}"
|
|
|
|
start-stop-daemon --stop --pidfile /var/run/dhcp/${SVCNAME}.pid
|
|
|
|
eend $?
|
|
|
|
}
|