Skip to content

Instantly share code, notes, and snippets.

@lamont-granquist
Created September 24, 2010 16:43
Show Gist options
  • Save lamont-granquist/595652 to your computer and use it in GitHub Desktop.
Save lamont-granquist/595652 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# returns the name of the Xen virt from within the guest DomU.
#
# requires xe-guest-utilities to be installed.
#
let i=0
while [ $i -le 100 ]; do
NAME=$(/usr/bin/xenstore-read /local/domain/$i/name 2> /dev/null)
[ -n "${NAME}" ] && break
let i++
done
[ -n "${NAME}" ] && echo ${NAME}
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment