summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/ubuntu/ip-redirect-all
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-11-28 07:17:11 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-11-28 07:17:11 +0000
commit14f1ada7b2bb66c6c3dae496d3963e9af3f0ab38 (patch)
tree01d610b53ba9b2088138d057f16ed6e5122cfe36 /sca-cpp/trunk/ubuntu/ip-redirect-all
parent6c67a3ca11e4bcd7715d92df2e3e41e4e3fc0dc9 (diff)
Use different servers for cert-based and password-based auth and use event MPMs for tunnel and proxy servers.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1039840 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/ubuntu/ip-redirect-all')
-rwxr-xr-xsca-cpp/trunk/ubuntu/ip-redirect-all5
1 files changed, 5 insertions, 0 deletions
diff --git a/sca-cpp/trunk/ubuntu/ip-redirect-all b/sca-cpp/trunk/ubuntu/ip-redirect-all
index aba5bc15ae..f796b0589e 100755
--- a/sca-cpp/trunk/ubuntu/ip-redirect-all
+++ b/sca-cpp/trunk/ubuntu/ip-redirect-all
@@ -22,5 +22,10 @@ here=`readlink -f $0`; here=`dirname $here`
sport=$1
tport=$2
+# Cleanup existing rules
+sudo /sbin/iptables -t nat -S PREROUTING | grep "\-p tcp" | grep "\-\-dport $sport" | grep "\-j REDIRECT" | sed "s/^-A/-D/" | awk -F "\t" '{ printf "sudo /sbin/iptables -t nat %s\n", $1 }' | /bin/sh
+sudo /sbin/iptables -t nat -S OUTPUT | grep "\-p tcp" | grep "\-\-dport $sport" | grep "\-j REDIRECT" | sed "s/^-A/-D/" | awk -F "\t" '{ printf "sudo /sbin/iptables -t nat %s\n", $1 }' | /bin/sh
+
+# Redirect traffic
/sbin/ifconfig | grep "inet addr:" | awk -F ":" '{ print $2 }' | awk '{ print $1 }' | xargs -i $here/ip-redirect $sport $tport {}