Commit 119891f5 by Rinat K. Nugaev

Added automatic exit if cant create ssh session with current login

parent 54ff7c84
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
# EDITED : 19-07-2017 # EDITED : 19-07-2017
# COMMENT : This script creates tunnels for Unicredit servers in DMZ # COMMENT : This script creates tunnels for Unicredit servers in DMZ
# Use it for your own risk! # Use it for your own risk!
# VERSION : 2.1 # VERSION : 2.2
########################################################### ###########################################################
# #
#CHANGELOG #CHANGELOG
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
# - Changed users's array creating # - Changed users's array creating
# - Function added # - Function added
# - Added automatic adding username after first successful login # - Added automatic adding username after first successful login
# - Added automatic exit if cant create ssh session with current login
user="" user=""
#Defining some colours for fun ))) #Defining some colours for fun )))
RED='\033[0;31m' RED='\033[0;31m'
...@@ -34,7 +35,8 @@ if [ -z "$user" ] ; then ...@@ -34,7 +35,8 @@ if [ -z "$user" ] ; then
echo "Adding username $user for future use in the script" echo "Adding username $user for future use in the script"
sed -i -e '0,/user=""/s/user=""/user='$user'/' $0 sed -i -e '0,/user=""/s/user=""/user='$user'/' $0
else else
echo "Username defined! Trying to connect..." echo "Cant create ssh session with $user login! Exiting..."
exit 0
fi fi
fi fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment