summaryrefslogtreecommitdiffstats
path: root/genome-autostarter/genome-autostarter.sh
diff options
context:
space:
mode:
Diffstat (limited to 'genome-autostarter/genome-autostarter.sh')
-rw-r--r--genome-autostarter/genome-autostarter.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/genome-autostarter/genome-autostarter.sh b/genome-autostarter/genome-autostarter.sh
new file mode 100644
index 0000000..1555d05
--- /dev/null
+++ b/genome-autostarter/genome-autostarter.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+uname -a | grep -i xen
+if [ $? == 0 ]; then
+ # We're using Xen
+ find /etc/xen/auto -name "*" -type l | xargs -n1 basename 2> /dev/null | xargs -n1 virsh start &> /dev/null
+else
+ # We're using kvm
+ for vm_xml in `find /etc/libvirt/qemu/autostart -name "*" -type l`; do
+ vm=`basename $vm_xml .xml` # Chop of the extension
+ virsh start $vm &> /dev/null
+ done
+fi