Tobias Brunner 5057455674 testing: ssh script forwards arguments to ssh command
This allows to execute commands on a virtual host.
2013-03-05 17:40:12 +01:00

22 lines
327 B
Bash
Executable File

#!/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
shift
exec ssh $SSHCONF -q root@$ip $@