zsh supported

This commit is contained in:
tavo-wasd 2024-02-16 17:27:14 -06:00
parent a58fb33b2a
commit 54092b14e5

View file

@ -10,8 +10,8 @@ urlencode() {
}
get_asp_var() {
VARS="$@" ; i=0
for VAR in $VARS ; do
i=0
for VAR in __VIEWSTATE __VIEWSTATEGENERATOR __EVENTVALIDATION ; do
VAL="$(printf '%s' "$RESPONSE" | grep "id=\"$VAR\"" | cut -d '"' -f 8 | urlencode)"
[ "$i" != 0 ] && printf '&'
printf '%s=%s' "$VAR" "$VAL"
@ -42,7 +42,7 @@ download_iso() {
RESPONSE="$(curl -s --compressed "$URL" -o -)"
ASP_VARS="$(get_asp_var __VIEWSTATE __VIEWSTATEGENERATOR __EVENTVALIDATION)"
ASP_VARS="$(get_asp_var)"
RESPONSE="$(curl -Ls --compressed "$URL" \
--data-raw "__EVENTTARGET=ctl00%24certContents%24ddlInstaladores" \
--data-raw "__EVENTARGUMENT=" \
@ -57,7 +57,7 @@ download_iso() {
--data-raw "ctl00%24certContents%24hiddenABID=" \
-o -)"
ASP_VARS="$(get_asp_var __VIEWSTATE __VIEWSTATEGENERATOR __EVENTVALIDATION)"
ASP_VARS="$(get_asp_var)"
RESPONSE="$(curl -H "Set-Cookie: SN=$SN" -s --compressed "$URL" \
--cookie "SN=$SN" \
--data-raw "__EVENTTARGET=ctl00%24certContents%24LinkButton3" \