diff options
author | wxs <wxs@FreeBSD.org> | 2011-06-03 20:31:24 +0800 |
---|---|---|
committer | wxs <wxs@FreeBSD.org> | 2011-06-03 20:31:24 +0800 |
commit | 9da4b84ab4f6240891085ecb62331db92c977042 (patch) | |
tree | f93068e46d76484541e3e788eb383aee19c8b955 /net | |
parent | 1a3a05559dfab407565d7a5260d9f072fda9a5b5 (diff) | |
download | freebsd-ports-gnome-9da4b84ab4f6240891085ecb62331db92c977042.tar.gz freebsd-ports-gnome-9da4b84ab4f6240891085ecb62331db92c977042.tar.zst freebsd-ports-gnome-9da4b84ab4f6240891085ecb62331db92c977042.zip |
net/isc-dchp41-server port installs two RC_SUBR scripts: isc-dhcpd and
isc-dhcpd6 when it is built with IPv6 support. net/isc-dchp41-relay could be
built with IPv6 support, but it doesn't provide way to start two realys (for
IPv4 and IPv6) simultaneously. This patch changes RC_SUBR script isc-dhcrelay
to support such operations, and install link from isc-dhcrelay to isc-dhcrelay6
when port is built with IPv6 support.
PR: ports/157501
Submitted by: lev@
Approved by: Douglas Thrift <douglas@douglasthrift.net> (maintainer)
Diffstat (limited to 'net')
-rw-r--r-- | net/isc-dhcp41-relay/pkg-plist | 2 | ||||
-rw-r--r-- | net/isc-dhcp41-server/Makefile | 6 | ||||
-rw-r--r-- | net/isc-dhcp41-server/files/isc-dhcrelay.in | 38 |
3 files changed, 38 insertions, 8 deletions
diff --git a/net/isc-dhcp41-relay/pkg-plist b/net/isc-dhcp41-relay/pkg-plist index 769520a1f3f7..e41a24f5b35a 100644 --- a/net/isc-dhcp41-relay/pkg-plist +++ b/net/isc-dhcp41-relay/pkg-plist @@ -1,4 +1,6 @@ @comment $FreeBSD$ @unexec %D/etc/rc.d/isc-dhcrelay.sh forcestop 2>/dev/null || true @unexec %D/etc/rc.d/isc-dhcrelay forcestop 2>/dev/null || true +%%IPV6%%@unexec %D/etc/rc.d/isc-dhcrelay6 forcestop 2>/dev/null || true +%%IPV6%%etc/rc.d/isc-dhcrelay6 sbin/dhcrelay diff --git a/net/isc-dhcp41-server/Makefile b/net/isc-dhcp41-server/Makefile index dac9276099ef..b0f66decc837 100644 --- a/net/isc-dhcp41-server/Makefile +++ b/net/isc-dhcp41-server/Makefile @@ -24,7 +24,7 @@ LICENSE= ISCL PATCHLEVEL= R2 PORTREVISION_SERVER= 0 PORTREVISION_CLIENT= 0 -PORTREVISION_RELAY= 0 +PORTREVISION_RELAY= 1 SUBSYS?= server WRKSRC= ${WRKDIR}/${PORTNAME}-${DISTVERSION}-${PATCHLEVEL} @@ -198,6 +198,10 @@ post-install: .if defined(WITH_DHCP_IPV6) @${LN} -sf isc-dhcpd ${PREFIX}/etc/rc.d/isc-dhcpd6 .endif +.elif ${SUBSYS} == relay +.if defined(WITH_DHCP_IPV6) + @${LN} -sf isc-dhcrelay ${PREFIX}/etc/rc.d/isc-dhcrelay6 +.endif .endif @${SED} ${PKGMESSAGE_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \ ${MSG_FILE} > ${PKGMESSAGE} diff --git a/net/isc-dhcp41-server/files/isc-dhcrelay.in b/net/isc-dhcp41-server/files/isc-dhcrelay.in index a12c72d3f2a7..a32b9856d037 100644 --- a/net/isc-dhcp41-server/files/isc-dhcrelay.in +++ b/net/isc-dhcp41-server/files/isc-dhcrelay.in @@ -1,6 +1,6 @@ #! /bin/sh # -# $FreeBSD: /tmp/pcvs/ports/net/isc-dhcp41-server/files/isc-dhcrelay.in,v 1.1 2010-05-06 20:24:01 wxs Exp $ +# $FreeBSD: /tmp/pcvs/ports/net/isc-dhcp41-server/files/isc-dhcrelay.in,v 1.2 2011-06-03 12:31:24 wxs Exp $ # # PROVIDE: dhcrelay # REQUIRE: DAEMON @@ -16,25 +16,49 @@ dhcrelay_enable=${dhcrelay_enable:-"NO"} # dhcrelay_servers="" # dhcrelay server(s) # dhcrelay_ifaces="" # ethernet interface(s) +case $0 in +/etc/rc*) + # during boot (shutdown) $0 is /etc/rc (/etc/rc.shutdown), + # so get the name of the script from $_file + name=$_file + ;; +*) + name=$0 + ;; +esac + +name=${name##*/isc-} + +case ${name} in +*6) + ipversion=-6 + ;; +*) + ipversion=-4 + ;; +esac + dhcrelay_precmd () { - local ifaces + local ifaces _servers _ifaces + + eval "_servers=\${${name}_servers}" + eval "_ifaces=\${${name}_ifaces}" - if [ -z "${dhcrelay_servers}" ]; then - err 1 "no dhcrelay server(s) configured." + if [ -z "${_servers}" ]; then + err 1 "no ${name} server(s) configured." fi ifaces= - for iface in ${dhcrelay_ifaces}; do + for iface in ${_ifaces}; do ifaces="${ifaces} -i ${iface}" done - rc_flags="${rc_flags} ${ifaces} ${dhcrelay_servers}" + rc_flags="${rc_flags} ${ipversion} ${ifaces} ${_servers}" } . /etc/rc.subr -name=dhcrelay rcvar=${name}_enable command=%%PREFIX%%/sbin/${name} |