summaryrefslogtreecommitdiff
path: root/pcr/openrc-net/dhcrelay.init3
diff options
context:
space:
mode:
authorfreaj <freaj@riseup.net>2015-03-30 10:08:17 +0200
committerfreaj <freaj@riseup.net>2015-03-30 10:08:17 +0200
commit41c9dc8729840f45f174a14a08703e04d1f5717e (patch)
treefeddfb083b443556f04bac84c6519d356e061854 /pcr/openrc-net/dhcrelay.init3
parent7f0385668a7eb0caf6a74f13d10c1fda5c7ad86d (diff)
openrc-net: add new package to [pcr]
Diffstat (limited to 'pcr/openrc-net/dhcrelay.init3')
-rw-r--r--pcr/openrc-net/dhcrelay.init334
1 files changed, 34 insertions, 0 deletions
diff --git a/pcr/openrc-net/dhcrelay.init3 b/pcr/openrc-net/dhcrelay.init3
new file mode 100644
index 000000000..fe4ec8c6d
--- /dev/null
+++ b/pcr/openrc-net/dhcrelay.init3
@@ -0,0 +1,34 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/files/dhcrelay.init3,v 1.3 2012/11/11 21:42:02 vapier Exp $
+
+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 $?
+}