summaryrefslogtreecommitdiff
path: root/rebind
diff options
context:
space:
mode:
authorJoel Martin <github@martintribe.org>2011-01-12 18:09:54 -0600
committerJoel Martin <github@martintribe.org>2011-01-12 18:09:54 -0600
commit6d1e216115d5ab84dafed0c91c40f58f7857c877 (patch)
treef31b592d73b1ec35736097c542d2ea51e6861d8b /rebind
parent932e7318b93ecbb59bdf6c22917cc70e03831d86 (diff)
downloadwebsockify-6d1e216115d5ab84dafed0c91c40f58f7857c877.tar.gz
fork noVNC, rename to websockify, cleanup.
Split of wsproxy from noVNC and rename it websockify.
Diffstat (limited to 'rebind')
-rwxr-xr-xrebind18
1 files changed, 18 insertions, 0 deletions
diff --git a/rebind b/rebind
new file mode 100755
index 0000000..6912d20
--- /dev/null
+++ b/rebind
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+usage() {
+ echo "Usage: $(basename $0) OLD_PORT NEW_PORT COMMAND_LINE"
+ echo
+ echo "Launch COMMAND_LINE, but intercept system calls to bind"
+ echo "to OLD_PORT and instead bind them to localhost:NEW_PORT"
+ exit 2
+}
+
+# Parameter defaults
+mydir=$(readlink -f $(dirname ${0}))
+
+export REBIND_PORT_OLD="${1}"; shift
+export REBIND_PORT_NEW="${1}"; shift
+
+LD_PRELOAD=${mydir}/rebind.so "${@}"
+