Skip to content

Instantly share code, notes, and snippets.

@mizzy
Created November 9, 2012 06:58
Show Gist options
  • Select an option

  • Save mizzy/4044138 to your computer and use it in GitHub Desktop.

Select an option

Save mizzy/4044138 to your computer and use it in GitHub Desktop.
#!/bin/sh
mount_point=/mnt/vm
if test ! -d $mount_point; then
mkdir -p $mount_point
fi
for vm in `virsh list --all|grep -v running|grep original|awk '{print $2}'`
do
echo "Set routing on $vm ..."
guestmount -d $vm -i $mount_point
grep route.pl $mount_point/etc/rc.d/rc.local > /dev/null
if test $? -ne 0; then
echo "curl https://raw.github.com/gist/3824987/routes.pl | perl" >> $mount_point/etc/rc.d/rc.local
fi
umount $mount_point
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment