mirror of
https://github.com/strongswan/strongswan.git
synced 2025-10-07 00:01:49 -04:00
testing: ssh script accepts IP addresses instead of host names
This commit is contained in:
parent
5057455674
commit
45ee7c9429
15
testing/ssh
15
testing/ssh
@ -10,11 +10,18 @@ then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
host=$1
|
host=$1
|
||||||
ip="`echo $HOSTNAMEIPV4 | sed -n -e "s/^.*${host},//gp" | awk -F, '{ print $1 }' | awk '{ print $1 }'`"
|
echo "$host" | grep -q "^\([0-9]\+\.\|[0-9a-fA-F]\+:\).*"
|
||||||
if [ -z $ip ]
|
if [ $? -eq 0 ]
|
||||||
then
|
then
|
||||||
echo "Host '$host' unknown"
|
# assume we got an ip address
|
||||||
exit 1
|
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
|
fi
|
||||||
|
|
||||||
shift
|
shift
|
||||||
|
Loading…
x
Reference in New Issue
Block a user