Skip to content
Snippets Groups Projects
Commit 2ea682db authored by Mathis Rosenhauer's avatar Mathis Rosenhauer
Browse files

TightVNC also supports -passwd option

parent a56637ed
No related branches found
No related tags found
No related merge requests found
......@@ -12,8 +12,7 @@
# patient.
#
# The vncviewer client has to support the -via option. TurboVNC,
# TigerVNC and TightVNC are known to work. You have to specify your
# vncviewer type because they differ in accepted and required options.
# TigerVNC and TightVNC are known to work.
set -e
......@@ -26,16 +25,13 @@ QOS=normal # <-- Set here an alternative QOS
# if desired
GEOMETRY=${1:-"1920x1200"} # <-- Set here the resolution of
# your remote desktop window
VNCTYPE=TightVNC # <-- Set to your vncviewer type.
# Can be one of TightVNC,
# TigerVNC, or TurboVNC
#OPTIONS="-extssh" # <-- Uncomment this if you use
# TurboVNC as vncviewer
VNCVIEWER=/usr/bin/vncviewer # <-- Set here the correct path to
# your local vncviewer
PASSWORD=true # <-- If enabled, the vncpassword
# will be temporarily copied to
# the local workstation
# (effective only with TurboVNC
# or TigerVNC)
MISTRAL="${USERNAME}@mistral.dkrz.de"
......@@ -114,18 +110,12 @@ host_and_display=$(ssh ${MISTRAL} "/bin/bash .startvnc/gethost.${job_id}")
vnc_host=${host_and_display%:*}
vnc_display=${host_and_display#*:}
vncv_options="-via ${USERNAME}@${vnc_host}.dkrz.de"
viewer_options="${OPTIONS} -via ${USERNAME}@${vnc_host}.dkrz.de"
# Set options depending on vncviewer type
if [[ ${VNCTYPE} = TurboVNC ]]; then
vncv_options+=" -extssh"
fi
if [[ ${VNCTYPE} = TurboVNC ]] || [[ ${VNCTYPE} = TigerVNC ]]; then
copy_password=${PASSWORD}
fi
# Start VNC client
if [[ ${copy_password} = true ]]; then
if [[ ${PASSWORD} = true ]]; then
scp -q ${MISTRAL}:.vnc/passwd ${HOME}/vnc_passwd
vncv_options+=" -PasswordFile ${HOME}/vnc_passwd"
viewer_options+=" -passwd ${HOME}/vnc_passwd"
fi
${VNCVIEWER} ${vncv_options} :${vnc_display}
# Start VNC viewer
${VNCVIEWER} ${viewer_options} :${vnc_display}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment