_err "You don't specify dnsla api id and key yet."
_err "Please create your key and try again."
_err "You didn't specify a dnsla api id and key yet."
return 1
fi
...
...
@@ -25,13 +26,30 @@ dns_la_add() {
_saveaccountconf_mutable LA_Id "$LA_Id"
_saveaccountconf_mutable LA_Key "$LA_Key"
_debug "detect the root zone"
_debug "First detect the root zone"
if! _get_root "$fulldomain";then
_err "invalid domain"
return 1
fi
add_record "$_domain""$_sub_domain""$txtvalue"
_debug _domain_id "$_domain_id"
_debug _sub_domain "$_sub_domain"
_debug _domain "$_domain"
_info "Adding record"
if _la_rest "record.ashx?cmd=create&apiid=$LA_Id&apipass=$LA_Key&rtype=json&domainid=$_domain_id&host=$_sub_domain&recordtype=TXT&recorddata=$txtvalue&recordline=";then
if _contains "$response"'"resultid":';then
_info "Added, OK"
return 0
elif _contains "$response"'"code":532';then
_info "Already exists, OK"
return 0
else
_err "Add txt record error."
return 1
fi
fi
_err "Add txt record error."
return 1
}
...
...
@@ -48,45 +66,33 @@ dns_la_rm() {
_err "invalid domain"
return 1
fi
_debug _domain_id "$_domain_id"
_debug _sub_domain "$_sub_domain"
_debug _domain "$_domain"
if! _rest GET "record.ashx?cmd=listn&apiid=$LA_Id&apipass=$LA_Key&rtype=json&domainid=$_domain_id&domain=$_domain&host=$_sub_domain&recordtype=TXT&recorddata=$txtvalue";then
if! _rest GET "record.ashx?cmd=create&apiid=$LA_Id&apipass=$LA_Key&rtype=json&domainid=$_domain_id&host=$_sub_domain&recordtype=TXT&recorddata=$txtvalue&recordline=";then