strongswan.org
Wiki/Project Management
Downloads
Gitweb
projects
/
strongswan.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5057455
)
testing: ssh script accepts IP addresses instead of host names
author
Tobias Brunner
<tobias@strongswan.org>
Mon, 4 Mar 2013 10:55:26 +0000
(11:55 +0100)
committer
Tobias Brunner
<tobias@strongswan.org>
Tue, 5 Mar 2013 16:40:13 +0000
(17:40 +0100)
testing/ssh
patch
|
blob
|
history
diff --git
a/testing/ssh
b/testing/ssh
index
9e6d49a
..
0de44d0
100755
(executable)
--- a/
testing/ssh
+++ b/
testing/ssh
@@
-10,11
+10,18
@@
then
fi
host=$1
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
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
fi
shift