Created
February 24, 2022 18:29
-
-
Save AlexRogalskiy/9829766062a52dae54f57cd2a42185fe to your computer and use it in GitHub Desktop.
xenstore dump that actually works
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/sh | |
dumpkey() { | |
local param=${1} | |
local key | |
local result | |
local param_prefix | |
result=$(xenstore-list ${param}) | |
if [ x"${param}" = x"/" ] | |
then | |
param_prefix="" | |
else | |
param_prefix="${param}" | |
fi | |
if [ -n "${result}" ] | |
then | |
for key in ${result} | |
do | |
dumpkey "${param_prefix}/${key}" | |
done | |
else | |
echo -n ${param}'=' ; xenstore-read "${param}" | |
fi | |
} | |
dumpkey ${1:-/} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment