From f21e606b6ef679e415734633533b82cda4887e9f Mon Sep 17 00:00:00 2001
From: MB <michael.blaschek@univie.ac.at>
Date: Mon, 29 Mar 2021 11:29:22 +0200
Subject: [PATCH] update connect scripts

---
 SSH-VPN-VNC/connect2jet | 12 ++++++------
 SSH-VPN-VNC/connect2vpn |  8 ++++++--
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/SSH-VPN-VNC/connect2jet b/SSH-VPN-VNC/connect2jet
index 28cd33d..b599496 100755
--- a/SSH-VPN-VNC/connect2jet
+++ b/SSH-VPN-VNC/connect2jet
@@ -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}"
diff --git a/SSH-VPN-VNC/connect2vpn b/SSH-VPN-VNC/connect2vpn
index c81a531..92e02f2 100755
--- a/SSH-VPN-VNC/connect2vpn
+++ b/SSH-VPN-VNC/connect2vpn
@@ -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
-- 
GitLab