Browse Source

Update dns_mydnsjp.sh

To fit current mydns.jp web site.
pull/4212/head
msys0843 2 years ago
committed by GitHub
parent
commit
0de3bf0ac7
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      dnsapi/dns_mydnsjp.sh

16
dnsapi/dns_mydnsjp.sh

@ -150,7 +150,7 @@ _get_root() {
_mydnsjp_retrieve_domain() { _mydnsjp_retrieve_domain() {
_debug "Login to MyDNS.JP" _debug "Login to MyDNS.JP"
response="$(_post "masterid=$MYDNSJP_MasterID&masterpwd=$MYDNSJP_Password" "$MYDNSJP_API/?MENU=100")"
response="$(_post "MENU=100&masterid=$MYDNSJP_MasterID&masterpwd=$MYDNSJP_Password" "$MYDNSJP_API/members/")"
cookie="$(grep -i '^set-cookie:' "$HTTP_HEADER" | _head_n 1 | cut -d " " -f 2)" cookie="$(grep -i '^set-cookie:' "$HTTP_HEADER" | _head_n 1 | cut -d " " -f 2)"
# If cookies is not empty then logon successful # If cookies is not empty then logon successful
@ -159,22 +159,8 @@ _mydnsjp_retrieve_domain() {
return 1 return 1
fi fi
_debug "Retrieve DOMAIN INFO page"
export _H1="Cookie:${cookie}"
response="$(_get "$MYDNSJP_API/?MENU=300")"
if [ "$?" != "0" ]; then
_err "Fail to retrieve DOMAIN INFO."
return 1
fi
_root_domain=$(echo "$response" | grep "DNSINFO\[domainname\]" | sed 's/^.*value="\([^"]*\)".*/\1/') _root_domain=$(echo "$response" | grep "DNSINFO\[domainname\]" | sed 's/^.*value="\([^"]*\)".*/\1/')
# Logout
response="$(_get "$MYDNSJP_API/?MENU=090")"
_debug _root_domain "$_root_domain" _debug _root_domain "$_root_domain"
if [ -z "$_root_domain" ]; then if [ -z "$_root_domain" ]; then

Loading…
Cancel
Save