From c81f4e559666d285e464dcedf826dd6ac6f41b30 Mon Sep 17 00:00:00 2001 From: "Guilherme G. Piccoli" Date: Sat, 23 Dec 2023 14:35:15 -0500 Subject: [PATCH] common: Support loading config files from /etc This is quite simple in fact: just added another loop to read config files from /etc/kdumpst.d/ - /etc takes precedence over /usr/share, like most of config files found in the field (/etc is usually the way for users to customize something). Signed-off-by: Guilherme G. Piccoli --- common.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/common.sh b/common.sh index b715b33..7a115d6 100644 --- a/common.sh +++ b/common.sh @@ -11,10 +11,17 @@ load_kdumpst_config() { HAVE_CFG_FILES=1 fi done + + for cfg in "/etc/kdumpst.d"/*; do + if [ -f "$cfg" ]; then + . "$cfg" + HAVE_CFG_FILES=1 + fi + done shopt -u nullglob if [ ${HAVE_CFG_FILES} -eq 0 ]; then - logger "kdumpst: no config files in /usr/share/kdumpst.d/ - aborting." + logger "kdumpst: no config files in /usr/share/kdumpst.d/ or /etc/kdumpst.d/ - aborting." exit 1 fi }