From 619b3fd111b41adb0d3c0ab88c99146befaec885 Mon Sep 17 00:00:00 2001 From: Erik Date: Sun, 24 Jul 2016 11:58:18 -0400 Subject: [PATCH] OSX hates readlink, handle spaces in file paths --- utils/launch.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/utils/launch.sh b/utils/launch.sh index af350b0a..25ef7951 100755 --- a/utils/launch.sh +++ b/utils/launch.sh @@ -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