Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
unic_connect
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Rinat K. Nugaev
unic_connect
Commits
73bfcddc
Commit
73bfcddc
authored
Jul 20, 2017
by
Rinat K. Nugaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added checking username and add successful username to the script for future use
parent
22dba06a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
unic_connect.sh
+13
-2
No files found.
unic_connect.sh
View file @
73bfcddc
...
@@ -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 : 1.
0
# VERSION : 1.
3
###########################################################
###########################################################
#
#
#CHANGELOG
#CHANGELOG
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
# - Added better variables checking
# - Added better variables checking
# - Changed users's array creating
# - Changed users's array creating
# - Function added
# - Function added
user
=
""
user
=
nrk
#Defining some colours for fun )))
#Defining some colours for fun )))
RED
=
'\033[0;31m'
RED
=
'\033[0;31m'
NC
=
'\033[0m'
NC
=
'\033[0m'
...
@@ -31,6 +31,17 @@ else
...
@@ -31,6 +31,17 @@ else
echo
"Username defined! Trying to connect..."
echo
"Username defined! Trying to connect..."
fi
fi
#Cheking username for ssh connection and if good then add it to script variables
statusssh
=
$(
ssh
-o
BatchMode
=
yes
-o
ConnectTimeout
=
5
-p
10022
$user
@tunnel01.rbtechnologies.ru
echo
ok 2>&1
)
if
[[
$statusssh
==
ok
]]
;
then
echo
"Adding username
$user
for future use in script"
sed
-i
-e
's/user=nrk/user='
$user
'/g'
$0
else
echo
other_error
fi
#Create function with port and name of hostname
#Create function with port and name of hostname
function
create_tunnel
function
create_tunnel
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment