Skip to content

Instantly share code, notes, and snippets.

@AlexRogalskiy
Created February 24, 2022 18:29
Show Gist options
  • Save AlexRogalskiy/9829766062a52dae54f57cd2a42185fe to your computer and use it in GitHub Desktop.
Save AlexRogalskiy/9829766062a52dae54f57cd2a42185fe to your computer and use it in GitHub Desktop.
xenstore dump that actually works
#!/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