Skip to content
Snippets Groups Projects
Commit f21e606b authored by Michael Blaschek's avatar Michael Blaschek :bicyclist:
Browse files

update connect scripts

parent 0329b3e9
No related branches found
No related tags found
No related merge requests found
......@@ -12,8 +12,8 @@ help() {
$0 -g [gateway] -p [port] -r [remote-port] user@remote
Options:
-g [gateway] gateway server, e.g. user@login.univie.ac.at
-p [port] port to forward from jet to local, egv VNC port
-r [port] remote port if not the same as port
-p [port] port to forward from jet to local, e.g. VNC port
-r [port] remote port if not the same as port
Example:
$0 -g [U:Account-Username]@login.univie.ac.at [Jet-Username]@jet01.img.univie.ac.at
......@@ -61,12 +61,12 @@ remote_status=false
gateway_status=false
if [ -e $HOME/.ssh/config ]; then
# 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
remote_status=true
fi
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
gateway_status=true
fi
......@@ -89,11 +89,11 @@ if [ -n "${gateway}" ]; then
echo "$(date) | ssh $command -t $gateway 'ssh ${command} ${remote}'" >>.${script/.sh/.log}
fi
else
if [ ! $remote_status ] ; then
if [ ! $remote_status ]; then
echo "Could fail if not: [user]@[server]"
fi
echo "Direct connection to: ${remote}"
ssh ${command} ${remote}
echo "$(date) | ssh ${command} ${remote}" >>.${script/.sh/.log}
fi
echo "Command Log in .${script/.sh/.log}"
\ No newline at end of file
echo "Command Log in .${script/.sh/.log}"
......@@ -19,7 +19,10 @@ if [ $? -ne 0 ]; then
exit 1
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 ..."
f5fpc -s -t vpn.univie.ac.at -u ${VPN_USER}
else
......@@ -30,4 +33,5 @@ fi
watch -n 10 'f5fpc --info'
echo "[VPN] Shutting down ..."
# Disconnect
f5fpc -o
\ No newline at end of file
f5fpc -o
echo "[VPN] disconnected"
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment