Custom shell to allow a user to connect to its sliver using the slice_name.
[nodemanager.git] / sshsh
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 "$@"