mirror of
https://github.com/acmesh-official/acme.sh.git
synced 2026-10-21 21:31:51 +00:00
Compare commits
0
Commits
master
..
f5f2242d60
No files matched your search
@@ -2914,7 +2914,6 @@ _setopt() {
|
||||
_err "Cannot read $__conf."
|
||||
return 1
|
||||
fi
|
||||
__old_text="$__text"
|
||||
#build the new content first and write it once through _write_conf:
|
||||
#redirecting straight into the conf truncates it before anything is
|
||||
#written, so a failing sed (#2426) or a failing write (#7247) left a
|
||||
@@ -2931,13 +2930,6 @@ _setopt() {
|
||||
_debug3 APP
|
||||
__text="$__text${__text:+$__nl}$__opt$__sep$__val$__end"
|
||||
fi
|
||||
if [ -z "$__sed_err" ] && [ "$__text" = "$__old_text" ]; then
|
||||
#the value is already saved: callers re-save the same values on every
|
||||
#run, and each write is a temp file plus a rename, which is slow on
|
||||
#some storage (#7335)
|
||||
_debug3 "Unchanged, skip writing $__conf"
|
||||
return 0
|
||||
fi
|
||||
if [ "$__sed_err" ] || ! _write_conf "$__conf" "$__text"; then
|
||||
_err "Cannot save '$__opt' to $__conf."
|
||||
return 1
|
||||
@@ -2967,19 +2959,11 @@ _clear_conf() {
|
||||
_c_c_f="$1"
|
||||
_sdkey="$2"
|
||||
if [ "$_c_c_f" ]; then
|
||||
_c_c_old="$(cat "$_c_c_f")"
|
||||
_conf_data="$(cat "$_c_c_f")"
|
||||
#printf, not echo: dash's builtin echo interprets backslash escapes and
|
||||
#would corrupt saved values that contain them on every rewrite
|
||||
if ! _conf_data="$(printf -- "%s\n" "$_c_c_old" | sed "/^$_sdkey *=.*$/d")"; then
|
||||
_err "Cannot clear '$_sdkey' in $_c_c_f."
|
||||
return 1
|
||||
fi
|
||||
#the key is not there, the usual case for the legacy keys cleared on
|
||||
#every _savedeployconf: nothing to write (#7335)
|
||||
if [ "$_conf_data" = "$_c_c_old" ]; then
|
||||
return 0
|
||||
fi
|
||||
if ! _write_conf "$_c_c_f" "$_conf_data"; then
|
||||
if ! _conf_data="$(printf -- "%s\n" "$_conf_data" | sed "/^$_sdkey *=.*$/d")" ||
|
||||
! _write_conf "$_c_c_f" "$_conf_data"; then
|
||||
_err "Cannot clear '$_sdkey' in $_c_c_f."
|
||||
return 1
|
||||
fi
|
||||
|
||||
+5
-10
@@ -15,7 +15,7 @@ DNSimple_API="https://api.dnsimple.com/v2"
|
||||
|
||||
# Usage: add _acme-challenge.www.domain.com "XKrxpRBosdIKFzxW_CT3KLZNf6q0HG9i01zxXp5CPBs"
|
||||
dns_dnsimple_add() {
|
||||
fulldomain=$(echo "$1" | _lower_case)
|
||||
fulldomain=$1
|
||||
txtvalue=$2
|
||||
|
||||
DNSimple_OAUTH_TOKEN="${DNSimple_OAUTH_TOKEN:-$(_readaccountconf_mutable DNSimple_OAUTH_TOKEN)}"
|
||||
@@ -56,7 +56,7 @@ dns_dnsimple_add() {
|
||||
|
||||
# fulldomain
|
||||
dns_dnsimple_rm() {
|
||||
fulldomain=$(echo "$1" | _lower_case)
|
||||
fulldomain=$1
|
||||
|
||||
DNSimple_OAUTH_TOKEN="${DNSimple_OAUTH_TOKEN:-$(_readaccountconf_mutable DNSimple_OAUTH_TOKEN)}"
|
||||
if [ -z "$DNSimple_OAUTH_TOKEN" ]; then
|
||||
@@ -110,13 +110,9 @@ _get_root() {
|
||||
return 1
|
||||
fi
|
||||
|
||||
if ! _contains "$response" "\"name\":\"$h\""; then
|
||||
if ! _dnsimple_rest GET "$_account_id/zones/$h/records?per_page=1"; then
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if _contains "$response" "\"name\":\"$h\"" || _contains "$response" '"pagination":'; then
|
||||
if _contains "$response" 'not found'; then
|
||||
_debug "$h not found"
|
||||
else
|
||||
_sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$previous")
|
||||
_domain="$h"
|
||||
|
||||
@@ -125,7 +121,6 @@ _get_root() {
|
||||
|
||||
return 0
|
||||
fi
|
||||
_debug "$h not found"
|
||||
|
||||
previous="$i"
|
||||
i=$(_math "$i" + 1)
|
||||
|
||||