summaryrefslogtreecommitdiffstats
path: root/main/dhcp/dhcrelay.initd
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2010-02-16 17:33:21 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2010-02-16 18:20:47 +0000
commitf10bb5847f65f3222c5d9a3ac6ed30f37c0ccca0 (patch)
tree232e109e6f565935f5cca37fbe32f11d617bd45a /main/dhcp/dhcrelay.initd
parent7a488bed5282efb0104d9ccecf7bd14a2686ba83 (diff)
downloadaports-f10bb5847f65f3222c5d9a3ac6ed30f37c0ccca0.tar.bz2
aports-f10bb5847f65f3222c5d9a3ac6ed30f37c0ccca0.tar.xz
main/dhcp: create dhcrelay subpackage with init.d script
fixes #281 (cherry picked from commit 669e19155dc8d1649d48fa4a2ee8c972f2ff453d)
Diffstat (limited to 'main/dhcp/dhcrelay.initd')
-rw-r--r--main/dhcp/dhcrelay.initd33
1 files changed, 33 insertions, 0 deletions
diff --git a/main/dhcp/dhcrelay.initd b/main/dhcp/dhcrelay.initd
new file mode 100644
index 00000000..dc55bf0f
--- /dev/null
+++ b/main/dhcp/dhcrelay.initd
@@ -0,0 +1,33 @@
+#!/sbin/runscript
+# 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/dhcrelay.pid
+ eend $?
+}