Make path to ld preload library absolute so wswrapper works even if path is changed before main program is executed (i.e. by the vncserver wrapper script). bind() was using the return value for the port number, but it's actually the original port number that we should interpose on in the bind() routine.
23 lines
415 B
Bash
Executable File
23 lines
415 B
Bash
Executable File
#!/bin/bash
|
|
|
|
usage() {
|
|
echo "Usage: $(basename $0) PORT CMDLINE"
|
|
echo
|
|
echo " PORT Port to wrap with WebSockets support"
|
|
echo " CMDLINE Command line to wrap"
|
|
exit 2
|
|
}
|
|
|
|
# Parameter defaults
|
|
mydir=$(readlink -f $(dirname ${0}))
|
|
|
|
# Process parameters
|
|
#while [ "${1}" != "${1#-}" ]; do
|
|
# param=$1; shift
|
|
#done
|
|
|
|
export WSWRAP_PORT="${1}"; shift
|
|
|
|
LD_PRELOAD=${mydir}/wswrapper.so "${@}"
|
|
|