mirror of
https://github.com/plantroon/acme.sh.git
synced 2024-12-24 14:11:42 +00:00
commit
28b0929554
@ -8,7 +8,6 @@
|
|||||||
#LUA_Email="user@luadns.net"
|
#LUA_Email="user@luadns.net"
|
||||||
|
|
||||||
LUA_Api="https://api.luadns.com/v1"
|
LUA_Api="https://api.luadns.com/v1"
|
||||||
LUA_auth=$(printf "%s" "$LUA_Email:$LUA_Key" | _base64)
|
|
||||||
|
|
||||||
######## Public functions #####################
|
######## Public functions #####################
|
||||||
|
|
||||||
@ -19,6 +18,8 @@ dns_lua_add() {
|
|||||||
|
|
||||||
LUA_Key="${LUA_Key:-$(_readaccountconf_mutable LUA_Key)}"
|
LUA_Key="${LUA_Key:-$(_readaccountconf_mutable LUA_Key)}"
|
||||||
LUA_Email="${LUA_Email:-$(_readaccountconf_mutable LUA_Email)}"
|
LUA_Email="${LUA_Email:-$(_readaccountconf_mutable LUA_Email)}"
|
||||||
|
LUA_auth=$(printf "%s" "$LUA_Email:$LUA_Key" | _base64)
|
||||||
|
|
||||||
if [ -z "$LUA_Key" ] || [ -z "$LUA_Email" ]; then
|
if [ -z "$LUA_Key" ] || [ -z "$LUA_Email" ]; then
|
||||||
LUA_Key=""
|
LUA_Key=""
|
||||||
LUA_Email=""
|
LUA_Email=""
|
||||||
@ -60,6 +61,7 @@ dns_lua_rm() {
|
|||||||
|
|
||||||
LUA_Key="${LUA_Key:-$(_readaccountconf_mutable LUA_Key)}"
|
LUA_Key="${LUA_Key:-$(_readaccountconf_mutable LUA_Key)}"
|
||||||
LUA_Email="${LUA_Email:-$(_readaccountconf_mutable LUA_Email)}"
|
LUA_Email="${LUA_Email:-$(_readaccountconf_mutable LUA_Email)}"
|
||||||
|
LUA_auth=$(printf "%s" "$LUA_Email:$LUA_Key" | _base64)
|
||||||
_debug "First detect the root zone"
|
_debug "First detect the root zone"
|
||||||
if ! _get_root "$fulldomain"; then
|
if ! _get_root "$fulldomain"; then
|
||||||
_err "invalid domain"
|
_err "invalid domain"
|
||||||
|
@ -59,10 +59,10 @@ dns_nsone_add() {
|
|||||||
_err "Add txt record error."
|
_err "Add txt record error."
|
||||||
else
|
else
|
||||||
_info "Updating record"
|
_info "Updating record"
|
||||||
record_id=$(printf "%s\n" "$response" | _egrep_o "\"domain\":\"$fulldomain.\",[^{]*\"type\":\"TXT\",\"id\":\"[^,]*\"" | _head_n 1 | cut -d: -f7 | cut -d, -f1)
|
prev_txt=$(printf "%s\n" "$response" | _egrep_o "\"domain\":\"$fulldomain\",\"short_answers\":\[\"[^,]*\]" | _head_n 1 | cut -d: -f3 | cut -d, -f1)
|
||||||
_debug "record_id" "$record_id"
|
_debug "prev_txt" "$prev_txt"
|
||||||
|
|
||||||
_nsone_rest POST "zones/$_domain/$fulldomain/TXT" "{\"answers\": [{\"answer\": [\"$txtvalue\"]}],\"type\": \"TXT\",\"domain\":\"$fulldomain\",\"zone\": \"$_domain\"}"
|
_nsone_rest POST "zones/$_domain/$fulldomain/TXT" "{\"answers\": [{\"answer\": [\"$txtvalue\"]},{\"answer\": $prev_txt}],\"type\": \"TXT\",\"domain\":\"$fulldomain\",\"zone\": \"$_domain\"}"
|
||||||
if [ "$?" = "0" ] && _contains "$response" "$fulldomain"; then
|
if [ "$?" = "0" ] && _contains "$response" "$fulldomain"; then
|
||||||
_info "Updated!"
|
_info "Updated!"
|
||||||
#todo: check if the record takes effect
|
#todo: check if the record takes effect
|
||||||
|
Loading…
Reference in New Issue
Block a user