aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Matveychuk <sem@FreeBSD.org>2008-02-03 16:24:34 +0000
committerSergey Matveychuk <sem@FreeBSD.org>2008-02-03 16:24:34 +0000
commit622f0540479f843d7ab0296bfef56bc27e532198 (patch)
tree4c2c7194643ee6e303d6099d7c39ab4f6378ea6c
parent6dfb696e9ea34cec3794b9f21f315d9566591c12 (diff)
downloadports-622f0540479f843d7ab0296bfef56bc27e532198.tar.gz
ports-622f0540479f843d7ab0296bfef56bc27e532198.zip
- Add a rc-script.
Submitted by: Stefan Thurner <thurners_at_nicsys.de>
Notes
Notes: svn path=/head/; revision=206668
-rw-r--r--www/transproxy/Makefile2
-rw-r--r--www/transproxy/files/tproxy.in68
2 files changed, 70 insertions, 0 deletions
diff --git a/www/transproxy/Makefile b/www/transproxy/Makefile
index 1384d8bce150..2e4e5cab0fa0 100644
--- a/www/transproxy/Makefile
+++ b/www/transproxy/Makefile
@@ -16,6 +16,8 @@ EXTRACT_SUFX= .tgz
MAINTAINER= sem@FreeBSD.org
COMMENT= Transparent HTTP proxy for ipfw's fwd rule or IPFILTER's ipnat command
+USE_RC_SUBR= tproxy
+
MAN8= tproxy.8
PLIST_FILES= sbin/tproxy sbin/tproxyrun sbin/tproxywatch
diff --git a/www/transproxy/files/tproxy.in b/www/transproxy/files/tproxy.in
new file mode 100644
index 000000000000..e78c4230f9eb
--- /dev/null
+++ b/www/transproxy/files/tproxy.in
@@ -0,0 +1,68 @@
+#!/bin/sh
+# Copyright (c) 2007 Stefan Thurner
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+#
+
+#
+# tproxy - rcNG start script for transproxy
+#
+# PROVIDE: tproxy
+# REQUIRE: NETWORKING privoxy cleanvar
+# KEYWORD: shutdown
+#
+
+#
+# Add the following line to /etc/rc.conf to enable `tproxy':
+# tproxy_enable="YES"
+#
+# tproxy_port="81"
+# tproxy_user="nobody"
+# tproxy_if="192.168.1.1"
+# tproxy_proxyhost="proxy.host"
+# tproxy_proxyport="8080"
+#
+# Or set your own flags:
+# tproxy_flags="-s $tproxy_port -b $tproxy_if -r $tproxy_user \
+# $tproxy_proxyhost $tproxy_proxyport"
+#
+# Run `tproxy --help' for tproxy_flags.
+#
+
+. %%RC_SUBR%%
+
+name="tproxy"
+rcvar=`set_rcvar`
+command="%%PREFIX%%/sbin/$name"
+pidfile="/var/run/${name}.pid"
+procname="%%PREFIX%%/sbin/$name"
+
+load_rc_config "$name"
+: ${tproxy_enable="NO"}
+: ${tproxy_user="nobody"}
+: ${tproxy_flags="-s $tproxy_port -b $tproxy_if -r $tproxy_user \
+ $tproxy_proxyhost $tproxy_proxyport"}
+
+run_rc_command "$1"