From d23317da5d6fa473045241542b502eebb247a156 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Sat, 20 Apr 2019 01:50:39 +0200 Subject: [PATCH] Check for the websockify binary in both the PATH (using which) and in the location where the Snap package places the binary. This is necessary for noVNC to be usable in a Snap. It doesn't affect the original functionality of git clon'ing websockify if it's not found in PATH or the Snap location --- utils/launch.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/utils/launch.sh b/utils/launch.sh index 162607eb..b110df1f 100755 --- a/utils/launch.sh +++ b/utils/launch.sh @@ -128,9 +128,12 @@ if [[ -e ${HERE}/websockify ]]; then echo "Using local websockify at $WEBSOCKIFY" else - WEBSOCKIFY=$(which websockify 2>/dev/null) + WEBSOCKIFY_FROMSYSTEM=$(which websockify 2>/dev/null) + WEBSOCKIFY_FROMSNAP=/snap/bin/novnc.websockify + [ -f $WEBSOCKIFY_FROMSYSTEM ] && WEBSOCKIFY=$WEBSOCKIFY_FROMSYSTEM + [ -f $WEBSOCKIFY_FROMSNAP ] && WEBSOCKIFY=$WEBSOCKIFY_FROMSNAP - if [[ $? -ne 0 ]]; then + if [ ! -f "$WEBSOCKIFY" ]; then echo "No installed websockify, attempting to clone websockify..." WEBSOCKIFY=${HERE}/websockify/run git clone https://github.com/novnc/websockify ${HERE}/websockify