Skip to content
Snippets Groups Projects
Commit 414b0aae authored by Gerhard's avatar Gerhard
Browse files

fixed issue with unknown tunnel name

parent 4c14774a
No related branches found
No related tags found
No related merge requests found
...@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment