aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Alves Grando <mnag@FreeBSD.org>2006-02-10 00:52:49 +0000
committerMarcus Alves Grando <mnag@FreeBSD.org>2006-02-10 00:52:49 +0000
commitbdbed380028d996c63ed3b860c8be7528165c61f (patch)
tree095f4e4fc9af7d340c3baf0613cfe952c032e957
parent300435f077a71bf83897fa137a66b63acdf20b6c (diff)
downloadports-bdbed380028d996c63ed3b860c8be7528165c61f.tar.gz
ports-bdbed380028d996c63ed3b860c8be7528165c61f.zip
Notes
-rw-r--r--net/redir/Makefile5
-rw-r--r--net/redir/files/redir.in39
2 files changed, 43 insertions, 1 deletions
diff --git a/net/redir/Makefile b/net/redir/Makefile
index a996c8b3f5bb..3b18cfe0f4d1 100644
--- a/net/redir/Makefile
+++ b/net/redir/Makefile
@@ -7,17 +7,20 @@
PORTNAME= redir
PORTVERSION= 2.2.1
+PORTREVISION= 1
CATEGORIES= net
MASTER_SITES= http://sammy.net/~sammy/hacks/
MAINTAINER= markp@FreeBSD.org
COMMENT= A tcp connection redirection utility
+USE_RC_SUBR= redir
+
MAN1= redir.1
PLIST_FILES= bin/redir
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/redir ${PREFIX}/bin
- ${INSTALL_MAN} ${WRKSRC}/redir.man ${PREFIX}/man/man1/redir.1
+ ${INSTALL_MAN} ${WRKSRC}/redir.man ${MANPREFIX}/man/man1/redir.1
.include <bsd.port.mk>
diff --git a/net/redir/files/redir.in b/net/redir/files/redir.in
new file mode 100644
index 000000000000..51e3674313c1
--- /dev/null
+++ b/net/redir/files/redir.in
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# PROVIDE: redir
+# REQUIRE: DAEMON
+# KEYWORD: FreeBSD
+#
+# Add the following lines to /etc/rc.conf to enable redir:
+#
+# redir_enable (bool): Set it to "YES" to enable redir.
+# Default is "NO".
+# redir_flags (flags): Set flags to redir.
+# Default id "". see redir(1).
+# Example: "--lport=80 --cport=3128 --syslog"
+#
+
+. %%RC_SUBR%%
+
+name="redir"
+rcvar=`set_rcvar`
+
+load_rc_config $name
+
+: ${redir_enable="NO"}
+: ${redir_flags=""}
+
+command=%%PREFIX%%/bin/redir
+command_args="${redir_flags} &"
+start_precmd="${name}_flags_check"
+
+redir_flags_check()
+{
+ if [ "${redir_flags}" = "" ]; then
+ err 1 "\$redir_flags are required. see redir(1)"
+ fi
+}
+
+run_rc_command "$1"