diff options
Diffstat (limited to 'nonsystemd/dhcp-openrc/dhcrelay.initd')
-rw-r--r-- | nonsystemd/dhcp-openrc/dhcrelay.initd | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/nonsystemd/dhcp-openrc/dhcrelay.initd b/nonsystemd/dhcp-openrc/dhcrelay.initd new file mode 100644 index 000000000..bf8818046 --- /dev/null +++ b/nonsystemd/dhcp-openrc/dhcrelay.initd @@ -0,0 +1,33 @@ +#!/usr/bin/openrc-run +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +depend() { + need net + use logger ldap slapd +} + +start() { + if [ -z "${DHCRELAY_SERVERS}" ] ; then + eerror "No DHCRELAY_SERVERS specified in /etc/conf.d/${SVCNAME}" + return 1 + fi + + checkpath -d /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/bin/dhcrelay \ + -- -q ${iface_opts} ${DHCRELAY_OPTS} ${DHCRELAY_SERVERS} + eend $? +} + +stop() { + ebegin "Stopping ${SVCNAME}" + start-stop-daemon --stop --pidfile /run/dhcp/${SVCNAME}.pid + eend $? +} |