aboutsummaryrefslogtreecommitdiff
path: root/net/bounce
diff options
context:
space:
mode:
authorCheng-Lung Sung <clsung@FreeBSD.org>2006-11-10 00:44:59 +0000
committerCheng-Lung Sung <clsung@FreeBSD.org>2006-11-10 00:44:59 +0000
commitb5bbaa763accc609f2fe752163900dbffa3594bf (patch)
treeb9e72fa576d1292fda3c7f735ff099906863d3a0 /net/bounce
parent4d5df834d0d770a067682cc60031a4db076381f1 (diff)
downloadports-b5bbaa763accc609f2fe752163900dbffa3594bf.tar.gz
ports-b5bbaa763accc609f2fe752163900dbffa3594bf.zip
Notes
Diffstat (limited to 'net/bounce')
-rw-r--r--net/bounce/Makefile9
-rw-r--r--net/bounce/files/bounce.in52
2 files changed, 57 insertions, 4 deletions
diff --git a/net/bounce/Makefile b/net/bounce/Makefile
index 49573dccb7c2..ac92b62fe3fd 100644
--- a/net/bounce/Makefile
+++ b/net/bounce/Makefile
@@ -8,7 +8,7 @@
PORTNAME= bounce
PORTVERSION= 1.0
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= net security
MASTER_SITES= http://www.iagora.com/~espel/ \
${MASTER_SITE_LOCAL}
@@ -19,11 +19,12 @@ EXTRACT_SUFX= .c
MAINTAINER= matt@efs.org
COMMENT= Bounce tcp connections to another machine/port
-NO_WRKSUBDIR= yes
+USE_RC_SUBR= bounce
+WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
do-extract:
- @${MKDIR} ${WRKDIR}
- @${CP} ${DISTDIR}/${DISTFILES} ${WRKDIR}
+ @${MKDIR} ${WRKSRC}
+ @${CP} ${DISTDIR}/${DISTFILES} ${WRKSRC}
do-build:
(cd ${WRKSRC} && ${CC} ${CFLAGS} -o ${DISTNAME} ${DISTNAME}.c)
diff --git a/net/bounce/files/bounce.in b/net/bounce/files/bounce.in
new file mode 100644
index 000000000000..b0994302c451
--- /dev/null
+++ b/net/bounce/files/bounce.in
@@ -0,0 +1,52 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+#
+# PROVIDE: bounce
+# REQUIRE: NETWORKING
+#
+# Add the following line to /etc/rc.conf to enable bounce
+#
+# bounce_enable (bool): Set to "NO" by default.
+# Set it to "YES" to enable bounce.
+# bounce_connections (str): Name for each bounce connection.
+# bounce_connectionname_options (str): Commandline for each bounce connection.
+#
+
+. %%RC_SUBR%%
+
+name="bounce"
+rcvar=${name}_enable
+
+load_rc_config $name
+
+: ${bounce_enable="NO"}
+
+command="/usr/local/sbin/${name}"
+start_cmd="bounce_startcmd"
+
+bounce_startcmd()
+{
+ if [ -z "$rc_fast" -a -n "$rc_pid" ]; then
+ echo "${name} already running? (pid=$rc_pid)."
+ return 1
+ fi
+ if [ -z "${bounce_connections}" ]; then
+ err 1 "can't find bounce_connections in /etc/rc.conf"
+ fi
+ echo Starting ${name}.
+ for connection in ${bounce_connections}; do
+ eval options=\$bounce_${connection}_options
+ if [ -z "${options}" ]; then
+ continue
+ fi
+ cmd="${command} ${options}"
+ if [ -n "$bounce_user" ]; then
+ cmd="su -m $bounce_user -c '$cmd'"
+ fi
+ eval "$cmd"
+ done
+}
+
+run_rc_command "$1"