|
|
|
@ -69,7 +69,6 @@ dns_dnsever_rm() { |
|
|
|
# _sub_domain=_acme-challenge.www |
|
|
|
# _domain=domain.com |
|
|
|
|
|
|
|
|
|
|
|
_get_root() { |
|
|
|
domain=$1 |
|
|
|
i=2 |
|
|
|
@ -82,12 +81,11 @@ _get_root() { |
|
|
|
fi |
|
|
|
|
|
|
|
#<OPTION value="flywithu.com" selected>flywithu.com</OPTION> |
|
|
|
domains=$(printf "%s\n" "$response" | _egrep_o "OPTION value=\".+\""| tr -d '\n') |
|
|
|
domains=$(printf "%s\n" "$response" | _egrep_o "OPTION value=\".+\"" | tr -d '\n') |
|
|
|
_debug2 "h" "$h" |
|
|
|
_debug2 "domains" "$domains" |
|
|
|
|
|
|
|
|
|
|
|
if _contains "$domains" "$h" ;then |
|
|
|
if _contains "$domains" "$h"; then |
|
|
|
_sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p) |
|
|
|
_domain="$h" |
|
|
|
return 0 |
|
|
|
@ -98,7 +96,6 @@ _get_root() { |
|
|
|
return 1 |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
_get_check_count() { |
|
|
|
domain=$1 |
|
|
|
_err "res" "$response" |
|
|
|
@ -129,9 +126,8 @@ dnsever_domain_txt() { |
|
|
|
return 1 |
|
|
|
fi |
|
|
|
|
|
|
|
# newhref=$(echo "$response" | sed -E "s/.*\'(.*)\'<.*/\1/") |
|
|
|
newhref=$(printf "%s\n" "$response" | _egrep_o "'.+'"|cut -d\' -f2) |
|
|
|
|
|
|
|
# newhref=$(echo "$response" | sed -E "s/.*\'(.*)\'<.*/\1/") |
|
|
|
newhref=$(printf "%s\n" "$response" | _egrep_o "'.+'" | cut -d\' -f2) |
|
|
|
|
|
|
|
response=$(_post "" "$newhref") |
|
|
|
result=$? |
|
|
|
@ -140,8 +136,8 @@ dnsever_domain_txt() { |
|
|
|
return 1 |
|
|
|
fi |
|
|
|
|
|
|
|
# newhref=$(echo "$response" | sed -E "s/.*action=\"(.*)\" .*/\1/") |
|
|
|
newhref=$(printf "%s\n" "$response" | _egrep_o "https.+\" "|cut -d\" -f1) |
|
|
|
# newhref=$(echo "$response" | sed -E "s/.*action=\"(.*)\" .*/\1/") |
|
|
|
newhref=$(printf "%s\n" "$response" | _egrep_o "https.+\" " | cut -d\" -f1) |
|
|
|
response=$(_post "" "$newhref") |
|
|
|
result=$? |
|
|
|
if [ $result != 0 ] || [ -z "$response" ]; then |
|
|
|
@ -149,7 +145,6 @@ dnsever_domain_txt() { |
|
|
|
return 1 |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
response=$(_post "" "https://kr.dnsever.com/start.html") |
|
|
|
result=$? |
|
|
|
if [ $result != 0 ] || [ -z "$response" ]; then |
|
|
|
@ -160,7 +155,6 @@ dnsever_domain_txt() { |
|
|
|
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") |
|
|
|
@ -173,15 +167,9 @@ dnsever_domain_txt() { |
|
|
|
_debug2 "subdomain" "$_sub_domain" |
|
|
|
_debug2 "txt" "$domain_txt" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ "$action" = "add" ]; then |
|
|
|
##https://kr.dnsever.com/start.html?user_domain=flywithu.com&selected_menu=edittxt&skey=flywithu:f80f523d2254f1e2c56462ace327f256 |
|
|
|
# subname=$(echo "$domain_name" | sed "s/\.$user_domain\$//") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
##https://kr.dnsever.com/start.html?user_domain=flywithu.com&selected_menu=edittxt&skey=flywithu:f80f523d2254f1e2c56462ace327f256 |
|
|
|
# subname=$(echo "$domain_name" | sed "s/\.$user_domain\$//") |
|
|
|
|
|
|
|
response=$(_post "skey=$skey&user_domain=$_domain&selected_menu=edittxt&command=add_txt&subname=$_sub_domain&new_txt=$domain_txt" "https://kr.dnsever.com/start.html") |
|
|
|
|
|
|
|
@ -194,9 +182,8 @@ dnsever_domain_txt() { |
|
|
|
elif [ "$action" = "del" ]; then |
|
|
|
#https://kr.dnsever.com/start.html?user_domain=flywithu.com&selected_menu=edittxt&skey=flywithu:41e3390a9b7aee2cce36c0012bb042b6 |
|
|
|
response=$(_post "skey=$skey&user_domain=$_domain&selected_menu=edittxt" "https://kr.dnsever.com/start.html") |
|
|
|
# _debug2 "response" "$response" |cut -d\" -f1 |
|
|
|
seq_1=$(printf "%s\n" "$response" | _egrep_o "name=\"seq_1\" value=\".+\"" | cut -f3 -d= | tr -d \" ) |
|
|
|
|
|
|
|
# _debug2 "response" "$response" |cut -d\" -f1 |
|
|
|
seq_1=$(printf "%s\n" "$response" | _egrep_o "name=\"seq_1\" value=\".+\"" | cut -f3 -d= | tr -d \") |
|
|
|
|
|
|
|
response=$(_post "skey=$skey&user_domain=$_domain&selected_menu=edittxt&command=delete_txt&domain_for_txt_1=$domain_name&old_txt_1=$domain_txt&txt_1=$domain_txt&check[]=1&seq_1=$seq_1&subname=&new_txt=" "https://kr.dnsever.com/start.html") |
|
|
|
result=$? |
|
|
|
|