Custom shell to allow a user to connect to its sliver using the slice_name.
authorXavi Leon <xleon@ac.upc.edu>
Thu, 10 Nov 2011 17:08:31 +0000 (12:08 -0500)
committerXavi Leon <xleon@ac.upc.edu>
Thu, 10 Nov 2011 17:08:31 +0000 (12:08 -0500)
sshsh [new file with mode: 0755]

diff --git a/sshsh b/sshsh
new file mode 100755 (executable)
index 0000000..edcd667
--- /dev/null
+++ b/sshsh
@@ -0,0 +1,5 @@
+#!/bin/bash
+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
+ssh root@$IP "$@"