get subdomain page with acme.sh _get() rather than using curl

This commit is contained in:
David Kerr 2017-01-28 15:15:39 -05:00
parent 98c0716347
commit 6897fa9880

View File

@ -277,15 +277,12 @@ _freedns_login() {
# echo page retrieved (html) # echo page retrieved (html)
# returns 0 success # returns 0 success
_freedns_retrieve_subdomain_page() { _freedns_retrieve_subdomain_page() {
cookies=$1 _H1="Cookie: $1"
url="https://freedns.afraid.org/subdomain/" url="https://freedns.afraid.org/subdomain/"
_debug "Retrieve subdmoain page from FreeDNS" _debug "Retrieve subdmoain page from FreeDNS"
#TODO Not using acme.sh _get() function becuase I need to pass in the cookies.
htmlpage="$(curl --silent \ htmlpage="$(_get "$url")"
--user-agent "$USER_AGENT" \
--cookie "$cookies" \
$url )"
if [ $? != 0 ]; then if [ $? != 0 ]; then
_err "FreeDNS retrieve subdomins failed bad RC from cURL: $?" _err "FreeDNS retrieve subdomins failed bad RC from cURL: $?"
@ -299,7 +296,7 @@ _freedns_retrieve_subdomain_page() {
_debug2 "$htmlpage" _debug2 "$htmlpage"
echo "$htmlpage" printf "%s" "$htmlpage"
return 0 return 0
} }