]> git.proxmox.com Git - mirror_acme.sh.git/commitdiff
Clarify _readaccountconf_mutable_default
authormedmunds <medmunds@gmail.com>
Tue, 16 Feb 2021 22:41:21 +0000 (14:41 -0800)
committerAlexander Kulumbeg <kulumbeg@gmail.com>
Sun, 21 Mar 2021 15:20:32 +0000 (16:20 +0100)
notify/smtp.sh

index 42c1487c241ea64d13541f7d5fc67b4e88d2c5b2..fabde79bb8faffe0af39f51f0e37e2a088c795cb 100644 (file)
@@ -358,7 +358,7 @@ PYTHON
 #   - if MY_CONF is set _empty_, output $default_value
 #     (lets user `export MY_CONF=` to clear previous saved value
 #     and return to default, without user having to know default)
-#   - otherwise if _readaccountconf_mutable $name is non-empty, return that
+#   - otherwise if _readaccountconf_mutable MY_CONF is non-empty, return that
 #     (value of SAVED_MY_CONF from account.conf)
 #   - otherwise output $default_value
 _readaccountconf_mutable_default() {
@@ -366,8 +366,9 @@ _readaccountconf_mutable_default() {
   _default_value="$2"
 
   eval "_value=\"\$$_name\""
-  eval "_explicit_empty_value=\"\${${_name}+empty}\""
-  if [ -z "${_value}" ] && [ "${_explicit_empty_value:-}" != "empty" ]; then
+  eval "_name_is_set=\"\${${_name}+true}\""
+  # ($_name_is_set is "true" if $$_name is set to anything, including empty)
+  if [ -z "${_value}" ] && [ "${_name_is_set:-}" != "true" ]; then
     _value="$(_readaccountconf_mutable "$_name")"
   fi
   if [ -z "${_value}" ]; then