blob: 1c3861e110298001d8e6ada1e61604975c3a7370 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
--- a/utils/launch.sh
+++ b/utils/launch.sh
@@ -110,42 +110,11 @@
echo "Warning: could not find self.pem"
fi
-# try to find websockify (prefer local, try global, then download local)
-if [[ -e ${HERE}/websockify ]]; then
- WEBSOCKIFY=${HERE}/websockify/run
-
- if [[ ! -x $WEBSOCKIFY ]]; then
- echo "The path ${HERE}/websockify exists, but $WEBSOCKIFY either does not exist or is not executable."
- echo "If you intended to use an installed websockify package, please remove ${HERE}/websockify."
- exit 1
- fi
-
- echo "Using local websockify at $WEBSOCKIFY"
-else
- WEBSOCKIFY=$(which websockify 2>/dev/null)
-
- if [[ $? -ne 0 ]]; then
- echo "No installed websockify, attempting to clone websockify..."
- WEBSOCKIFY=${HERE}/websockify/run
- git clone https://github.com/novnc/websockify ${HERE}/websockify
-
- if [[ ! -e $WEBSOCKIFY ]]; then
- echo "Unable to locate ${HERE}/websockify/run after downloading"
- exit 1
- fi
-
- echo "Using local websockify at $WEBSOCKIFY"
- else
- echo "Using installed websockify at $WEBSOCKIFY"
- fi
-fi
-
echo "Starting webserver and WebSockets proxy on port ${PORT}"
-#${HERE}/websockify --web ${WEB} ${CERT:+--cert ${CERT}} ${PORT} ${VNC_DEST} &
-${WEBSOCKIFY} ${SSLONLY} --web ${WEB} ${CERT:+--cert ${CERT}} ${PORT} ${VNC_DEST} &
+${HERE}/websockify --web ${WEB} ${CERT:+--cert ${CERT}} ${PORT} ${VNC_DEST} &
proxy_pid="$!"
sleep 1
-if ! ps -p ${proxy_pid} >/dev/null; then
+if [ -z "$proxy_pid" ] || ! ps -o pid= | grep -qw ${proxy_pid}; then
proxy_pid=
echo "Failed to start WebSockets proxy"
exit 1
|