Created
June 25, 2017 20:07
-
-
Save jnovack/21e3aed2d5ff7a9f78d9895ec8353941 to your computer and use it in GitHub Desktop.
rancher-metadata recursion debug script
This file contains 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 | |
# 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