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
9ebe9d43
Commit
9ebe9d43
authored
Jul 19, 2017
by
Rinat K. Nugaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Worked without any functions
parents
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
0 deletions
+43
-0
unic_connect.sh
+43
-0
No files found.
unic_connect.sh
0 → 100755
View file @
9ebe9d43
#!/bin/bash
###########################################################
# AUTHOR : Rinat K. Nugaev - http://www.nugaev.net - support@nugaev.net
# DATE : 19-07-2017
# EDITED : 19-07-2017
# COMMENT : This script creates tunnels for Unicredit servers in DMZ
# Use it for your own risk!
# VERSION : 0.2
###########################################################
user
=
""
#Defining some colours for fun )))
RED
=
'\033[0;31m'
NC
=
'\033[0m'
GREEN
=
'\033[0;33m'
#Starting ssh-agent
eval
`
ssh-agent
-s
`
#Adding keys to ssh-agent
ssh-add
#Ask user for username
if
[
-z
"
$user
"
]
;
then
echo
"Username not defined in script, asking for username!"
read
-p
"Enter your username like PertrovPP:"
user
else
echo
"Username defined! Trying to connect..."
fi
#Declaring array of tunnels
declare
-A
tunnels
tunnels+
=(
[
"iv176"
]=
"ssh -f -N -o ExitOnForwardFailure=yes -p 10022 -L 5555:iv176.rbtechnologies.ru:3389
$user
@tunnel01.rbtechnologies.ru"
[
"ks262"
]=
"ssh -f -N -o ExitOnForwardFailure=yes -p 10022 -L 5556:ks261.rbtechnologies.ru:3389
$user
@tunnel01.rbtechnologies.ru"
[
"vs1027"
]=
"ssh -f -N -o ExitOnForwardFailure=yes -p 10022 -L 5557:vs1027.rbtechnologies.ru:3389
$user
@tunnel01.rbtechnologies.ru"
)
#Connecting...
for
conn
in
"
${
!tunnels[@]
}
"
;
do
if
${
tunnels
[
$conn
]
}
;
then
echo
-e
"
${
GREEN
}
Tunnel to the DMZ host
$conn
succesufully created!
${
NC
}
"
else
echo
-e
"
${
RED
}
Tunnel creation to the
$conn
FAIL (((
${
NC
}
"
fi
done
exit
0
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