Skip to content

Instantly share code, notes, and snippets.

@elpollodiablo
Created December 2, 2019 10:48
Show Gist options
  • Save elpollodiablo/fd1599f43f30206ca77012639430a901 to your computer and use it in GitHub Desktop.
Save elpollodiablo/fd1599f43f30206ca77012639430a901 to your computer and use it in GitHub Desktop.
#!/bin/sh
# podmanager
# URLBASE="https://admin:admin@10.8.2.121:8443"
URLBASE="https://root:calvin@10.8.2.123"
URLS="$URLBASE/redfish/v1"
while true;
do
NEWURLS=""
for URL in $URLS;
do
echo $URL
WITHOUT=`echo $URL|sed s,$URLBASE/,,g`
DIR="$WITHOUT"
FILE="$WITHOUT/xml"
mkdir -p "$DIR"
# mkdir -p
if [ -f "$FILE" ]; then
echo not doing $URL
else
MYURLS=`wget $URL --quiet --no-check-certificate -O - |tee "$FILE" |sed "s,\",\n,g"|grep "/redfish/v1" | sed "s,/redfish/v1,$URLBASE/redfish/v1,"`;
NEWURLS="$NEWURLS $MYURLS";
fi;
done
URLS="$NEWURLS"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment