Commit 119891f5 by Rinat K. Nugaev

Added automatic exit if cant create ssh session with current login

parent 54ff7c84
......@@ -5,7 +5,7 @@
# EDITED : 19-07-2017
# COMMENT : This script creates tunnels for Unicredit servers in DMZ
# Use it for your own risk!
# VERSION : 2.1
# VERSION : 2.2
###########################################################
#
#CHANGELOG
......@@ -14,6 +14,7 @@
# - Changed users's array creating
# - Function added
# - Added automatic adding username after first successful login
# - Added automatic exit if cant create ssh session with current login
user=""
#Defining some colours for fun )))
RED='\033[0;31m'
......@@ -34,7 +35,8 @@ if [ -z "$user" ] ; then
echo "Adding username $user for future use in the script"
sed -i -e '0,/user=""/s/user=""/user='$user'/' $0
else
echo "Username defined! Trying to connect..."
echo "Cant create ssh session with $user login! Exiting..."
exit 0
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