This commit is contained in:
kernel-sanders 2016-09-16 20:31:11 +00:00 committed by GitHub
commit d434a3e9af
1 changed files with 3 additions and 4 deletions

View File

@ -26,8 +26,7 @@ usage() {
}
NAME="$(basename $0)"
REAL_NAME="$(readlink -f $0)"
HERE="$(cd "$(dirname "$REAL_NAME")" && pwd)"
HERE="$( cd "$( dirname "$( dirname "$0" )" )" && pwd )"
PORT="6080"
VNC_DEST="localhost:5900"
CERT=""
@ -123,7 +122,7 @@ else
if [[ $? -ne 0 ]]; then
echo "No installed websockify, attempting to clone websockify..."
WEBSOCKIFY=${HERE}/websockify/run
git clone https://github.com/kanaka/websockify ${HERE}/websockify
git clone https://github.com/kanaka/websockify "${HERE}/websockify"
if [[ ! -e $WEBSOCKIFY ]]; then
echo "Unable to locate ${HERE}/websockify/run after downloading"
@ -138,7 +137,7 @@ fi
echo "Starting webserver and WebSockets proxy on port ${PORT}"
#${HERE}/websockify --web ${WEB} ${CERT:+--cert ${CERT}} ${PORT} ${VNC_DEST} &
${WEBSOCKIFY} --web ${WEB} ${CERT:+--cert ${CERT}} ${PORT} ${VNC_DEST} &
"${WEBSOCKIFY}" --web "${WEB}" ${CERT:+--cert ${CERT}} ${PORT} ${VNC_DEST} &
proxy_pid="$!"
sleep 1
if ! ps -p ${proxy_pid} >/dev/null; then