Created
September 24, 2010 16:43
-
-
Save lamont-granquist/595652 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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