Skip to content

Instantly share code, notes, and snippets.

@jnovack
Created June 25, 2017 20:07
Show Gist options
  • Save jnovack/21e3aed2d5ff7a9f78d9895ec8353941 to your computer and use it in GitHub Desktop.
Save jnovack/21e3aed2d5ff7a9f78d9895ec8353941 to your computer and use it in GitHub Desktop.
rancher-metadata recursion debug script
#!/bin/sh
# Recurse through http://rancher-metadata/ for debugging purposes
recurse() {
local URL=${1//\/\//\/};
for FILE in $(curl ${URL});
do
if [[ $FILE == "Not" || $FILE == "found" ]]; then
break;
fi;
FILE=`echo "$FILE" | sed -E "s/\d+=//g"`;
echo "${URL}/${FILE}";
recurse "${URL}/${FILE}";
done;
}
recurse http://rancher-metadata/latest/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment