mirror of
https://github.com/acmesh-official/acme.sh.git
synced 2026-10-21 13:31:18 +00:00
fix default value handling
This commit is contained in:
1 file changed
+20
-6
+20
-6
@@ -134,12 +134,26 @@ _bergdns_init() {
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
_saveaccountconf_mutable BERGDNS_API_KEY "$BERGDNS_API_KEY"
|
_saveaccountconf_mutable BERGDNS_API_KEY "$BERGDNS_API_KEY"
|
||||||
# Only what the user actually chose is written back. Persisting a default
|
# Only what the user actually chose is written back, and a value equal to
|
||||||
# would pin the install to today's value, and a later change to the shipped
|
# the default clears any older setting. Persisting a default would pin the
|
||||||
# one -- a move of the API base above all -- would never reach it.
|
# install to today's value, and a later change to the shipped one -- a move
|
||||||
[ "$BERGDNS_API_URL" = "$_BERGDNS_DEFAULT_URL" ] || _saveaccountconf_mutable BERGDNS_API_URL "$BERGDNS_API_URL"
|
# of the API base above all -- would never reach it; leaving an old setting
|
||||||
[ "$BERGDNS_TTL" = "$_BERGDNS_DEFAULT_TTL" ] || _saveaccountconf_mutable BERGDNS_TTL "$BERGDNS_TTL"
|
# in place would mean the environment could never put one back to default.
|
||||||
[ "$BERGDNS_PROPAGATION_TIMEOUT" = "$_BERGDNS_DEFAULT_WAIT" ] || _saveaccountconf_mutable BERGDNS_PROPAGATION_TIMEOUT "$BERGDNS_PROPAGATION_TIMEOUT"
|
if [ "$BERGDNS_API_URL" = "$_BERGDNS_DEFAULT_URL" ]; then
|
||||||
|
_clearaccountconf_mutable BERGDNS_API_URL
|
||||||
|
else
|
||||||
|
_saveaccountconf_mutable BERGDNS_API_URL "$BERGDNS_API_URL"
|
||||||
|
fi
|
||||||
|
if [ "$BERGDNS_TTL" = "$_BERGDNS_DEFAULT_TTL" ]; then
|
||||||
|
_clearaccountconf_mutable BERGDNS_TTL
|
||||||
|
else
|
||||||
|
_saveaccountconf_mutable BERGDNS_TTL "$BERGDNS_TTL"
|
||||||
|
fi
|
||||||
|
if [ "$BERGDNS_PROPAGATION_TIMEOUT" = "$_BERGDNS_DEFAULT_WAIT" ]; then
|
||||||
|
_clearaccountconf_mutable BERGDNS_PROPAGATION_TIMEOUT
|
||||||
|
else
|
||||||
|
_saveaccountconf_mutable BERGDNS_PROPAGATION_TIMEOUT "$BERGDNS_PROPAGATION_TIMEOUT"
|
||||||
|
fi
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||