From 38531354412f2c1fec251d49e54ab3a2dc230dc4 Mon Sep 17 00:00:00 2001
From: Mathis Rosenhauer <rosenhauer@dkrz.de>
Date: Wed, 21 Aug 2019 10:53:30 +0200
Subject: [PATCH] start-vnc: robustness

---
 start-vnc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/start-vnc b/start-vnc
index 2a4a728..0caa749 100755
--- a/start-vnc
+++ b/start-vnc
@@ -121,7 +121,7 @@ clean_up () {
     trap - ERR EXIT
     set +e
 
-    if ${SVNC_KILLSERVER}; then
+    if [[ "${SVNC_KILLSERVER}" = true ]]; then
         if [[ -n ${vnc_host:-} ]]; then
             echo "Killing vncserver :${vnc_display} on ${vnc_host}."
             ssh_frontend "ssh ${vnc_host} \"/opt/TurboVNC/bin/vncserver \
@@ -144,7 +144,7 @@ clean_up () {
     rmdir "${ssh_socket_dir}"
 
     # Remove local vnc PasswordFile
-    if ${SVNC_PASSWORD}; then
+    if [[ "${SVNC_PASSWORD}" = true ]]; then
         rm -f "vnc_passwd"
     fi
     exit
@@ -309,7 +309,7 @@ main () {
     done
     local client_options
     client_options="${SVNC_CLIENT_OPTIONS:-}"
-    if ${SVNC_PASSWORD}; then
+    if [[ "${SVNC_PASSWORD}" = true ]]; then
         echo "Fetching password from frontend."
         ssh_frontend "cat .vnc/passwd" > vnc_passwd
         client_options+=" -passwd vnc_passwd"
-- 
GitLab