testing: Reduce runtime of all tests that use SQLite databases by storing them in...
[strongswan.git] / testing / ssh
index 0de44d0..95d064c 100755 (executable)
@@ -2,6 +2,7 @@
 
 DIR=$(dirname `readlink -f $0`)
 . $DIR/testing.conf
+SSHCONF="-F $DIR/ssh_config"
 
 if [ $# == 0 ]
 then
@@ -16,7 +17,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"