if ! _rest GET "record.ashx?cmd=get&apiid=$LA_Id&apipass=$LA_Key&rtype=json&domainid=$_domain_id&domain=$_domain&recordid=$RM_recordid";then
_err "get record lis error."
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
_err "get record list error."
return1
return1
fi
fi
if ! _contains "$response""$RM_recordid";then
if ! _contains "$response""recordid";then
_info "no need to remove record."
_info "no need to remove record."
return0
return0
fi
fi
if ! _rest GET "record.ashx?cmd=remove&apiid=$LA_Id&apipass=$LA_Key&rtype=json&domainid=$_domain_id&domain=$_domain&recordid=$RM_recordid";then
if ! _rest GET "record.ashx?cmd=remove&apiid=$LA_Id&apipass=$LA_Key&rtype=json&domainid=$_domain_id&domain=$_domain&recordid=$_record_id";then
_err "record remove error."
_err "record remove error."
return1
return1
fi
fi
_clearaccountconf "$_fullkey"
_contains "$response""\"code\":300"
_contains "$response""\"code\":300"
}
}
@ -81,16 +79,12 @@ add_record() {
fulldomain="$sub.$root"
fulldomain="$sub.$root"
_info "adding txt record"
_info "adding txt record"
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
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