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

update connect scripts

parent 0329b3e9
Branches
Tags
No related merge requests found
...@@ -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, egv 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
...@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment