From: Tobias Brunner Date: Tue, 19 Feb 2013 13:17:26 +0000 (+0100) Subject: testing: Add a script to easily connect to a host via SSH X-Git-Tag: 5.0.3dr3~46 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9a70fe84126c9b1ebb42640faaf33f5e8bf47f7c;p=thirdparty%2Fstrongswan.git 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. --- diff --git a/testing/ssh b/testing/ssh new file mode 100755 index 0000000000..fc72c265e4 --- /dev/null +++ b/testing/ssh @@ -0,0 +1,20 @@ +#!/bin/bash + +DIR=$(dirname `readlink -f $0`) +. $DIR/testing.conf + +if [ $# == 0 ] +then + echo "$0 " + 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