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

This commit is contained in:
Tim Edwards 2019-04-20 01:50:39 +02:00
parent 9f46732090
commit d23317da5d
1 changed files with 5 additions and 2 deletions

View File

@ -128,9 +128,12 @@ if [[ -e ${HERE}/websockify ]]; then
echo "Using local websockify at $WEBSOCKIFY" echo "Using local websockify at $WEBSOCKIFY"
else 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..." echo "No installed websockify, attempting to clone websockify..."
WEBSOCKIFY=${HERE}/websockify/run WEBSOCKIFY=${HERE}/websockify/run
git clone https://github.com/novnc/websockify ${HERE}/websockify git clone https://github.com/novnc/websockify ${HERE}/websockify