Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
ssh_scripts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sofiane Bendoukha
ssh_scripts
Commits
7736e1fd
Commit
7736e1fd
authored
7 years ago
by
Mathis Rosenhauer
Browse files
Options
Downloads
Patches
Plain Diff
set -u
parent
c5385f62
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
startvnc
+15
-12
15 additions, 12 deletions
startvnc
with
15 additions
and
12 deletions
startvnc
+
15
−
12
View file @
7736e1fd
...
...
@@ -5,7 +5,8 @@
# Mathis Rosenhauer
# Deutsches Klimarechenzentrum GmbH
# Bundesstr. 45a
# 20146 Hamburg Germany
# 20146 Hamburg
# Germany
#
# All rights reserved.
#
...
...
@@ -49,7 +50,7 @@
# TigerVNC and TightVNC are known to work.
#
set
-e
set
-e
u
# Default settings
...
...
@@ -74,8 +75,9 @@ SVNC_VNCVIEWER="/usr/bin/vncviewer"
# Uncomment this if you use TurboVNC as vncviewer
#readonly SVNC_VNC_OPTIONS="-extssh"
# Frontend host. Must be directly accessible from client. Frontend
# and node where vnc server is running need a shared home file system.
# Frontend host. Must be directly accessible from client. The frontend
# and the node where vncserver is running need a shared home file
# system.
readonly
SVNC_FRONTEND_HOST
=
"mistral.dkrz.de"
# Copy vncpassword temporarily to the local workstation
...
...
@@ -105,7 +107,7 @@ clean_up () {
# Remove local vnc PasswordFile
if
[[
${
SVNC_PASSWORD
}
=
"true"
]]
;
then
rm
-f
${
HOME
}
/vnc_passwd
rm
-f
"
${
HOME
}
/vnc_passwd
"
fi
exit
}
...
...
@@ -117,15 +119,16 @@ usage () {
}
ssh_frontend
()
{
local
ssh_options
=
"
$2
-o ForwardX11=no
\
local command
=
"
$1
"
local
extra_options
=
"
${
2
:-}
"
local
options
=
"
${
extra_options
}
-o ForwardX11=no
\
-o ControlPath=
${
ssh_socket_dir
}
/control:%h:%p:%r"
ssh
${
ssh_
options
}
"
${
SVNC_USERNAME
}
@
${
SVNC_FRONTEND_HOST
}
"
"
$
1
"
ssh
${
options
}
"
${
SVNC_USERNAME
}
@
${
SVNC_FRONTEND_HOST
}
"
"
$
{
command
}
"
}
parse_options
()
{
local
option
while
getopts
'A:g:q:t:u:v:x:'
option
do
while
getopts
'A:g:q:t:u:v:x:'
option
;
do
case
${
option
}
in
A
)
SVNC_ACCTCODE
=
"
$OPTARG
"
;;
...
...
@@ -142,7 +145,7 @@ parse_options () {
x
)
SVNC_VNC_OPTIONS
=
"
$OPTARG
"
;;
?
)
usage
exit
2
exit
1
;;
esac
done
...
...
@@ -158,7 +161,7 @@ parse_options () {
if
[[
-z
${
SVNC_ACCTCODE
}
]]
||
[[
-z
${
SVNC_USERNAME
}
]]
;
then
printf
"ERROR: Please specify at least username and acctcode.
\n\n
"
>
&2
usage
exit
2
exit
1
fi
}
...
...
@@ -219,7 +222,7 @@ main () {
vnc_host
=
${
host_and_display
%
:
*
}
vnc_display
=
${
host_and_display
#*
:
}
local
vnc_options
=
"
${
SVNC_VNC_OPTIONS
}
\
local
vnc_options
=
"
${
SVNC_VNC_OPTIONS
:-
}
\
-via
${
SVNC_USERNAME
}
@
${
vnc_host
}
.dkrz.de"
if
[[
${
SVNC_PASSWORD
}
=
"true"
]]
;
then
ssh_frontend
"cat .vnc/passwd"
>
${
HOME
}
/vnc_passwd
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment