mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-04-21 07:51:26 +02:00
Fix globbing of CONFIG_D *.sh files.
With the globbing changes made in
61083cf522 to globally disable globbing by
default, this broke the ability to load the CONFIG_D `*.sh` files.
This re-enables globbing when reading these `*.sh` files and then disables it
again afterwards. Note that this also keeps globbing enabled inside the
loop, when sourcing the individual `*.sh` files for backwards
compatibility (so if the individual config scripts relied on the default
of globbing being enabled, there won't be any change in behavior).
This commit is contained in:
@@ -158,6 +158,9 @@ load_config() {
|
|||||||
_exiterr "The path ${CONFIG_D} specified for CONFIG_D does not point to a directory."
|
_exiterr "The path ${CONFIG_D} specified for CONFIG_D does not point to a directory."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Allow globbing
|
||||||
|
[[ -n "${ZSH_VERSION:-}" ]] && set +o noglob || set +f
|
||||||
|
|
||||||
for check_config_d in "${CONFIG_D}"/*.sh; do
|
for check_config_d in "${CONFIG_D}"/*.sh; do
|
||||||
if [[ -f "${check_config_d}" ]] && [[ -r "${check_config_d}" ]]; then
|
if [[ -f "${check_config_d}" ]] && [[ -r "${check_config_d}" ]]; then
|
||||||
echo "# INFO: Using additional config file ${check_config_d}"
|
echo "# INFO: Using additional config file ${check_config_d}"
|
||||||
@@ -166,7 +169,10 @@ load_config() {
|
|||||||
else
|
else
|
||||||
_exiterr "Specified additional config ${check_config_d} is not readable or not a file at all."
|
_exiterr "Specified additional config ${check_config_d} is not readable or not a file at all."
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Disable globbing
|
||||||
|
[[ -n "${ZSH_VERSION:-}" ]] && set -o noglob || set -f
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if we are running & are allowed to run as root
|
# Check if we are running & are allowed to run as root
|
||||||
|
|||||||
Reference in New Issue
Block a user