Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Computer Resources
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Monitor
Service Desk
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IMGW
Computer Resources
Commits
f21e606b
Commit
f21e606b
authored
4 years ago
by
Michael Blaschek
Browse files
Options
Downloads
Patches
Plain Diff
update connect scripts
parent
0329b3e9
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
SSH-VPN-VNC/connect2jet
+6
-6
6 additions, 6 deletions
SSH-VPN-VNC/connect2jet
SSH-VPN-VNC/connect2vpn
+6
-2
6 additions, 2 deletions
SSH-VPN-VNC/connect2vpn
with
12 additions
and
8 deletions
SSH-VPN-VNC/connect2jet
+
6
−
6
View file @
f21e606b
...
@@ -12,8 +12,8 @@ help() {
...
@@ -12,8 +12,8 @@ help() {
$0
-g [gateway] -p [port] -r [remote-port] user@remote
$0
-g [gateway] -p [port] -r [remote-port] user@remote
Options:
Options:
-g [gateway] gateway server, e.g. user@login.univie.ac.at
-g [gateway] gateway server, e.g. user@login.univie.ac.at
-p [port] port to forward from jet to local, e
gv
VNC port
-p [port] port to forward from jet to local, e
.g.
VNC port
-r [port] remote port if not the same as port
-r [port]
remote port if not the same as port
Example:
Example:
$0
-g [U:Account-Username]@login.univie.ac.at [Jet-Username]@jet01.img.univie.ac.at
$0
-g [U:Account-Username]@login.univie.ac.at [Jet-Username]@jet01.img.univie.ac.at
...
@@ -61,12 +61,12 @@ remote_status=false
...
@@ -61,12 +61,12 @@ remote_status=false
gateway_status
=
false
gateway_status
=
false
if
[
-e
$HOME
/.ssh/config
]
;
then
if
[
-e
$HOME
/.ssh/config
]
;
then
# check if hosts are there
# check if hosts are there
cat
$HOME
/.ssh/config |
grep
-i
'Host ${remote}'
>
/dev/null
cat
$HOME
/.ssh/config |
grep
-i
'Host ${remote}'
>
/dev/null
if
[
$?
-eq
0
]
;
then
if
[
$?
-eq
0
]
;
then
remote_status
=
true
remote_status
=
true
fi
fi
if
[
-n
${
gateway
}
]
;
then
if
[
-n
${
gateway
}
]
;
then
cat
$HOME
/.ssh/config |
grep
-i
'Host ${gateway}'
>
/dev/null
cat
$HOME
/.ssh/config |
grep
-i
'Host ${gateway}'
>
/dev/null
if
[
$?
-eq
0
]
;
then
if
[
$?
-eq
0
]
;
then
gateway_status
=
true
gateway_status
=
true
fi
fi
...
@@ -89,11 +89,11 @@ if [ -n "${gateway}" ]; then
...
@@ -89,11 +89,11 @@ if [ -n "${gateway}" ]; then
echo
"
$(
date
)
| ssh
$command
-t
$gateway
'ssh
${
command
}
${
remote
}
'"
>>
.
${
script
/.sh/.log
}
echo
"
$(
date
)
| ssh
$command
-t
$gateway
'ssh
${
command
}
${
remote
}
'"
>>
.
${
script
/.sh/.log
}
fi
fi
else
else
if
[
!
$remote_status
]
;
then
if
[
!
$remote_status
]
;
then
echo
"Could fail if not: [user]@[server]"
echo
"Could fail if not: [user]@[server]"
fi
fi
echo
"Direct connection to:
${
remote
}
"
echo
"Direct connection to:
${
remote
}
"
ssh
${
command
}
${
remote
}
ssh
${
command
}
${
remote
}
echo
"
$(
date
)
| ssh
${
command
}
${
remote
}
"
>>
.
${
script
/.sh/.log
}
echo
"
$(
date
)
| ssh
${
command
}
${
remote
}
"
>>
.
${
script
/.sh/.log
}
fi
fi
echo
"Command Log in .
${
script
/.sh/.log
}
"
echo
"Command Log in .
${
script
/.sh/.log
}
"
\ No newline at end of file
This diff is collapsed.
Click to expand it.
SSH-VPN-VNC/connect2vpn
+
6
−
2
View file @
f21e606b
...
@@ -19,7 +19,10 @@ if [ $? -ne 0 ]; then
...
@@ -19,7 +19,10 @@ if [ $? -ne 0 ]; then
exit
1
exit
1
fi
fi
if
[
$#
-eq
0
]
;
then
read
-p
"[VPN] Full (1) or split (None) tunnel? (1/None)"
REPLY
# echo "REPLY: $REPLY"
if
[
"
$REPLY
"
==
""
]
;
then
echo
"[VPN] Connecting split-tunnel ..."
echo
"[VPN] Connecting split-tunnel ..."
f5fpc
-s
-t
vpn.univie.ac.at
-u
${
VPN_USER
}
f5fpc
-s
-t
vpn.univie.ac.at
-u
${
VPN_USER
}
else
else
...
@@ -30,4 +33,5 @@ fi
...
@@ -30,4 +33,5 @@ fi
watch
-n
10
'f5fpc --info'
watch
-n
10
'f5fpc --info'
echo
"[VPN] Shutting down ..."
echo
"[VPN] Shutting down ..."
# Disconnect
# Disconnect
f5fpc
-o
f5fpc
-o
\ No newline at end of file
echo
"[VPN] disconnected"
\ No newline at end of file
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