aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2013-02-19 14:17:26 +0100
committerTobias Brunner <tobias@strongswan.org>2013-02-28 18:21:14 +0100
commit9a70fe84126c9b1ebb42640faaf33f5e8bf47f7c (patch)
treeaa34cfd2fa037b1cf3461d745b46d8c94faef547 /testing
parent81f9cd39fdf8cdb2634b4c5253f1d39fd9cf5123 (diff)
downloadstrongswan-9a70fe84126c9b1ebb42640faaf33f5e8bf47f7c.tar.bz2
strongswan-9a70fe84126c9b1ebb42640faaf33f5e8bf47f7c.tar.xz
testing: Add a script to easily connect to a host via SSH
This doesn't require any entries in /etc/hosts and the correct SSH config is used to allow password-less access.
Diffstat (limited to 'testing')
-rwxr-xr-xtesting/ssh20
1 files changed, 20 insertions, 0 deletions
diff --git a/testing/ssh b/testing/ssh
new file mode 100755
index 000000000..fc72c265e
--- /dev/null
+++ b/testing/ssh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+DIR=$(dirname `readlink -f $0`)
+. $DIR/testing.conf
+
+if [ $# == 0 ]
+then
+ echo "$0 <host>"
+ exit 1
+fi
+
+host=$1
+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
+
+exec ssh $SSHCONF -q root@$ip