Skip to content

Commit b3c1ddb

Browse files
committed
improve vnc server-lock check
-> seperate conditions
1 parent d652511 commit b3c1ddb

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

etc/scripts/vncserver/startvnc.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,18 @@ fi
1919

2020
if [ -f /tmp/.X11-unix/X${port} ]; then
2121
vnc=true
22-
elif [ -f /tmp/.X${port}-lock ]; then
23-
vnc=true
2422
else
2523
vnc=false
2624
fi
2725

26+
if [ -f /tmp/.X${port}-lock ]; then
27+
vnc=true
28+
else
29+
vnc=false
30+
fi
2831

2932
if ! $vnc; then
30-
vncserver -xstartup "${DEFAULT_XSTARTUP}" -desktop "udroid Default VNC" :${port}
33+
vncserver -xstartup "${DEFAULT_XSTARTUP}" -localhost no -desktop "udroid Default VNC" :${port}
3134
else
3235
echo "A vncserver lock is found for port ${port}"
3336
echo -e "Use \e[1;32mudroid stoptvnc\e[0m or \e[1;32mstopvnc\e[0m to stop it and try again..."

0 commit comments

Comments
 (0)