OSX hates readlink, handle spaces in file paths
This commit is contained in:
parent
da82b3426c
commit
619b3fd111
|
|
@ -26,8 +26,7 @@ usage() {
|
||||||
}
|
}
|
||||||
|
|
||||||
NAME="$(basename $0)"
|
NAME="$(basename $0)"
|
||||||
REAL_NAME="$(readlink -f $0)"
|
HERE="$( cd "$( dirname "$( dirname "$0" )" )" && pwd )"
|
||||||
HERE="$(cd "$(dirname "$REAL_NAME")" && pwd)"
|
|
||||||
PORT="6080"
|
PORT="6080"
|
||||||
VNC_DEST="localhost:5900"
|
VNC_DEST="localhost:5900"
|
||||||
CERT=""
|
CERT=""
|
||||||
|
|
@ -123,7 +122,7 @@ else
|
||||||
if [[ $? -ne 0 ]]; then
|
if [[ $? -ne 0 ]]; then
|
||||||
echo "No installed websockify, attempting to clone websockify..."
|
echo "No installed websockify, attempting to clone websockify..."
|
||||||
WEBSOCKIFY=${HERE}/websockify/run
|
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
|
if [[ ! -e $WEBSOCKIFY ]]; then
|
||||||
echo "Unable to locate ${HERE}/websockify/run after downloading"
|
echo "Unable to locate ${HERE}/websockify/run after downloading"
|
||||||
|
|
@ -138,7 +137,7 @@ fi
|
||||||
|
|
||||||
echo "Starting webserver and WebSockets proxy on port ${PORT}"
|
echo "Starting webserver and WebSockets proxy on port ${PORT}"
|
||||||
#${HERE}/websockify --web ${WEB} ${CERT:+--cert ${CERT}} ${PORT} ${VNC_DEST} &
|
#${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="$!"
|
proxy_pid="$!"
|
||||||
sleep 1
|
sleep 1
|
||||||
if ! ps -p ${proxy_pid} >/dev/null; then
|
if ! ps -p ${proxy_pid} >/dev/null; then
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue