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."
return 1
fi
if! _contains "$response""$RM_recordid";then
_info "no need to remove record."
return 0
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
_err "record remove error."
return 1
fi
_clearaccountconf "$_fullkey"
_contains "$response""\"code\":300"
}
#add the txt record.
#usage: root sub txtvalue
add_record(){
root=$1
sub=$2
txtvalue=$3
fulldomain="$sub.$root"
_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