aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2013-03-04 18:01:10 +0100
committerTobias Brunner <tobias@strongswan.org>2013-03-05 17:40:13 +0100
commiteeb029360ad6dd61ba790a801e456b0660615169 (patch)
treef63f08c2900044b8bec9320c476eacb9fa5b4bfe
parent45ee7c9429dc61ac355e5bebbaa77e711495cb67 (diff)
downloadstrongswan-eeb029360ad6dd61ba790a801e456b0660615169.tar.bz2
strongswan-eeb029360ad6dd61ba790a801e456b0660615169.tar.xz
testing: Enable ssh connection to second IP by name (e.g. moon1)
-rwxr-xr-xtesting/ssh10
1 files changed, 9 insertions, 1 deletions
diff --git a/testing/ssh b/testing/ssh
index 0de44d0a9..4777cfb47 100755
--- a/testing/ssh
+++ b/testing/ssh
@@ -16,7 +16,15 @@ then
# assume we got an ip address
ip=$host
else
- ip="`echo $HOSTNAMEIPV4 | sed -n -e "s/^.*${host},//gp" | awk -F, '{ print $1 }' | awk '{ print $1 }'`"
+ pos='$1'
+ echo "$host" | grep -q ".*1$"
+ if [ $? -eq 0 ]
+ then
+ # {host}1, use second address
+ pos='$2'
+ host=`echo "$host" | sed -n -e "s/1$//p"`
+ fi
+ ip="`echo $HOSTNAMEIPV4 | sed -n -e "s/^.*${host},//gp" | awk -F, "{ print ${pos} }" | awk '{ print $1 }'`"
if [ -z $ip ]
then
echo "Host '$host' unknown"