From 45ee7c9429dc61ac355e5bebbaa77e711495cb67 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Mon, 4 Mar 2013 11:55:26 +0100 Subject: [PATCH] testing: ssh script accepts IP addresses instead of host names --- testing/ssh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/testing/ssh b/testing/ssh index 9e6d49a610..0de44d0a9b 100755 --- a/testing/ssh +++ b/testing/ssh @@ -10,11 +10,18 @@ then fi host=$1 -ip="`echo $HOSTNAMEIPV4 | sed -n -e "s/^.*${host},//gp" | awk -F, '{ print $1 }' | awk '{ print $1 }'`" -if [ -z $ip ] +echo "$host" | grep -q "^\([0-9]\+\.\|[0-9a-fA-F]\+:\).*" +if [ $? -eq 0 ] then - echo "Host '$host' unknown" - exit 1 + # 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 }'`" + if [ -z $ip ] + then + echo "Host '$host' unknown" + exit 1 + fi fi shift -- 2.47.2