From a6df8628261efa587dfb01a1a1d7d1a4e2426e21 Mon Sep 17 00:00:00 2001 From: No GUI <14547+nogweii@users.noreply.github.com> Date: Fri, 30 Sep 2022 03:16:37 +0000 Subject: [PATCH] Enable null globs when scanning for config.d/*.sh Without this, an empty directory leads to an false error complaining that the file `/etc/dehydrated/config.d/*.sh` is not readable or doesn't exist. With `nullglob` set, the glob, if it doesn't match anything, will expand into null rather than returning the glob string, causing an empty config.d folder to not throw an error. --- pdns_api.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pdns_api.sh b/pdns_api.sh index 376eb29..ef23553 100755 --- a/pdns_api.sh +++ b/pdns_api.sh @@ -103,8 +103,10 @@ load_config() { if [[ -n "${ZSH_VERSION:-}" ]] then set +o noglob + setopt null_glob else set +f + shopt -s nullglob fi for check_config_d in "${CONFIG_D}"/*.sh; do @@ -121,8 +123,10 @@ load_config() { if [[ -n "${ZSH_VERSION:-}" ]] then set -o noglob + setopt no_null_glob else set -f + shopt -u nullglob fi fi