~ubuntu-branches/ubuntu/vivid/emscripten/vivid

« back to all changes in this revision

Viewing changes to third_party/websockify/rebind

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2013-05-02 13:11:51 UTC
  • Revision ID: package-import@ubuntu.com-20130502131151-q8dvteqr1ef2x7xz
Tags: upstream-1.4.1~20130504~adb56cb
ImportĀ upstreamĀ versionĀ 1.4.1~20130504~adb56cb

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env bash
 
2
 
 
3
usage() {
 
4
    echo "Usage: $(basename $0) OLD_PORT NEW_PORT COMMAND_LINE"
 
5
    echo
 
6
    echo "Launch COMMAND_LINE, but intercept system calls to bind"
 
7
    echo "to OLD_PORT and instead bind them to localhost:NEW_PORT"
 
8
    exit 2
 
9
}
 
10
 
 
11
# Parameter defaults
 
12
mydir=$(readlink -f $(dirname ${0}))
 
13
 
 
14
export REBIND_PORT_OLD="${1}"; shift
 
15
export REBIND_PORT_NEW="${1}"; shift
 
16
 
 
17
LD_PRELOAD=${mydir}/rebind.so "${@}"
 
18