Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
ssh-tunnel-manager
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open-source
ssh-tunnel-manager
Commits
414b0aae
Commit
414b0aae
authored
10 years ago
by
Gerhard
Browse files
Options
Downloads
Patches
Plain Diff
fixed issue with unknown tunnel name
parent
4c14774a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ssh-tunnel-manager.sh
+18
-7
18 additions, 7 deletions
ssh-tunnel-manager.sh
with
18 additions
and
7 deletions
ssh-tunnel-manager.sh
+
18
−
7
View file @
414b0aae
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
#
#
# @author Gerhard Steinbeis (info [at] tinned-software [dot] net)
# @author Gerhard Steinbeis (info [at] tinned-software [dot] net)
# @copyright Copyright (c) 2013
# @copyright Copyright (c) 2013
version
=
0.6.
3
version
=
0.6.
4
# @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, version 3
# @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, version 3
# @package net
# @package net
#
#
...
@@ -15,10 +15,10 @@ version=0.6.3
...
@@ -15,10 +15,10 @@ version=0.6.3
# Define names for the tunnel to identify them. The list needs to be configured
# Define names for the tunnel to identify them. The list needs to be configured
# in the same order as the tunnel config in the TUNELS list.
# in the same order as the tunnel config in the TUNELS list.
#
#
TUNNEL_NAMES
=(
#
TUNNEL_NAMES=(
"Tunnel-A"
#
"Tunnel-A"
"Tunnel-B"
#
"Tunnel-B"
)
#
)
#
#
# Ths TUNNELS array is used to configure the individual tunnels. Each
# Ths TUNNELS array is used to configure the individual tunnels. Each
...
@@ -242,8 +242,7 @@ function get_id_from_name
...
@@ -242,8 +242,7 @@ function get_id_from_name
return
return
fi
fi
done
done
echo
"The tunnel with the name '
$NAME
' can not be found."
echo
-1
exit
1
}
}
...
@@ -284,6 +283,10 @@ case $COMMAND in
...
@@ -284,6 +283,10 @@ case $COMMAND in
# check if a tunnel index has been provided
# check if a tunnel index has been provided
if
[[
"
$COMMAND_INDEX_NAME
"
!=
''
]]
;
then
if
[[
"
$COMMAND_INDEX_NAME
"
!=
''
]]
;
then
COMMAND_INDEX
=
$(
get_id_from_name
"
$COMMAND_INDEX_NAME
"
)
COMMAND_INDEX
=
$(
get_id_from_name
"
$COMMAND_INDEX_NAME
"
)
if
[[
"
$COMMAND_INDEX
"
-eq
"-1"
]]
;
then
echo
"The tunnel with the name '
$COMMAND_INDEX_NAME
' can not be found."
exit
1
fi
IDX_START
=
$COMMAND_INDEX
IDX_START
=
$COMMAND_INDEX
IDX_END
=
$((
COMMAND_INDEX+1
))
IDX_END
=
$((
COMMAND_INDEX+1
))
else
else
...
@@ -332,6 +335,10 @@ case $COMMAND in
...
@@ -332,6 +335,10 @@ case $COMMAND in
# check if a tunnel index has been provided
# check if a tunnel index has been provided
if
[[
"
$COMMAND_INDEX_NAME
"
!=
''
]]
;
then
if
[[
"
$COMMAND_INDEX_NAME
"
!=
''
]]
;
then
COMMAND_INDEX
=
$(
get_id_from_name
"
$COMMAND_INDEX_NAME
"
)
COMMAND_INDEX
=
$(
get_id_from_name
"
$COMMAND_INDEX_NAME
"
)
if
[[
"
$COMMAND_INDEX
"
-eq
"-1"
]]
;
then
echo
"The tunnel with the name '
$COMMAND_INDEX_NAME
' can not be found."
exit
1
fi
IDX_START
=
$COMMAND_INDEX
IDX_START
=
$COMMAND_INDEX
IDX_END
=
$((
COMMAND_INDEX+1
))
IDX_END
=
$((
COMMAND_INDEX+1
))
else
else
...
@@ -374,6 +381,10 @@ case $COMMAND in
...
@@ -374,6 +381,10 @@ case $COMMAND in
# check if a tunnel index has been provided
# check if a tunnel index has been provided
if
[[
"
$COMMAND_INDEX_NAME
"
!=
''
]]
;
then
if
[[
"
$COMMAND_INDEX_NAME
"
!=
''
]]
;
then
COMMAND_INDEX
=
$(
get_id_from_name
"
$COMMAND_INDEX_NAME
"
)
COMMAND_INDEX
=
$(
get_id_from_name
"
$COMMAND_INDEX_NAME
"
)
if
[[
"
$COMMAND_INDEX
"
-eq
"-1"
]]
;
then
echo
"The tunnel with the name '
$COMMAND_INDEX_NAME
' can not be found."
exit
1
fi
IDX_START
=
$COMMAND_INDEX
IDX_START
=
$COMMAND_INDEX
IDX_END
=
$((
COMMAND_INDEX+1
))
IDX_END
=
$((
COMMAND_INDEX+1
))
else
else
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment