diff --git a/dnsapi/dns_dnsever.sh b/dnsapi/dns_dnsever.sh index ba7034e2..e0735e50 100644 --- a/dnsapi/dns_dnsever.sh +++ b/dnsapi/dns_dnsever.sh @@ -97,7 +97,9 @@ dnsever_txt() { fi fi - skey=$(printf "%s\n" "$response" | grep skey | sed -n "s/^.*value=['\"]\(.*\)['\"].*/\1/p") + skey=$(printf "%s\n" "$response" | _egrep_o "name=\"skey\" value=\".+\"" | cut -f3 -d= | tr -d \") + _debug skey "$skey" + if [ -z "$skey" ]; then _err "dnsever_txt:$action ERROR login failed with login_id=$login_id login_password=$login_password" response=$(_post "skey=$skey" "https://kr.dnsever.com/logout.php") @@ -105,6 +107,7 @@ dnsever_txt() { fi user_domain=$(dnsever_select_user_domain "$fulldomain" "$response") + _debug user_domain "$user_domain" if [ -z "$user_domain" ]; then _err "dnsever_txt:$action ERROR no matching domain in DNSEver" @@ -115,6 +118,7 @@ dnsever_txt() { if [ "$action" = "add" ]; then subname=$(echo "$fulldomain" | sed "s/\.$user_domain\$//") + _debug subname "$subname" if [ -z "$subname" ] || [ -z "$txt" ]; then _err "dnsever_txt ERROR subname=$subname or txt=$txt is empty" @@ -203,7 +207,9 @@ dnsever_select_user_domain() { fulldomain="$1" response="$2" - domains=$(printf "%s\n" "$response" | grep OPTION | sed -n "s/^.*value=['\"]\(.*\)['\"].*/\1/p" | grep -v "^$") + domains=$(printf "%s\n" "$response" | awk '/