X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sshsh;h=b7a0264bb42835c403f3ca6aee003ec9424f29d0;hb=847dbc953996b120f254578e00fb8f9e03b425c1;hp=e80b8ab554046be7c30736e1754866c5cc82576d;hpb=55afbcaa2f8e9646bec3962e406f150f5d31b47b;p=nodemanager.git diff --git a/sshsh b/sshsh index e80b8ab..b7a0264 100755 --- a/sshsh +++ b/sshsh @@ -1,5 +1,23 @@ #!/bin/bash +# turn on debugging: +# either set verbose to true right here +# or call ssh slice@node -- -v .... +verbose= MAC=$(virsh --connect lxc:// --readonly dumpxml $USER|grep mac|awk -F\' '{print $2}') IP=$(cat /var/lib/libvirt/dnsmasq/default.leases | grep $MAC | awk '{print $3}') shift +case "$1" in -v|--verbose) verbose=true; shift ;; esac + +if [ -n "$verbose" ]; then + echo "sshsh: login=$USER" + echo "sshsh: args=>$@<" + echo "MAC=>$MAC<" + echo "IP=>$IP<" + echo "========== beg /var/lib/libvirt/dnsmasq/default.leases" + cat /var/lib/libvirt/dnsmasq/default.leases + echo "========== end /var/lib/libvirt/dnsmasq/default.leases" +fi + +[ -z "$IP" ] && { echo "No IP found" ; exit 1; } + exec ssh -o StrictHostKeyChecking=no root@$IP "$@"