2022-12-01 12:12:42 -03:00
|
|
|
|
|
|
|
|
# This function has the purpose of loading the necessary external
|
|
|
|
|
# variables, in the form of one (or more) configuration file(s). If the
|
|
|
|
|
# procedure fails, we must abort - otherwise it'll fail in a later stage.
|
2023-03-22 20:08:47 -03:00
|
|
|
load_kdumpst_config() {
|
2022-12-01 12:12:42 -03:00
|
|
|
HAVE_CFG_FILES=0
|
|
|
|
|
shopt -s nullglob
|
2023-03-22 20:08:47 -03:00
|
|
|
for cfg in "/usr/share/kdumpst.d"/*; do
|
2022-12-01 12:12:42 -03:00
|
|
|
if [ -f "$cfg" ]; then
|
|
|
|
|
. "$cfg"
|
|
|
|
|
HAVE_CFG_FILES=1
|
|
|
|
|
fi
|
|
|
|
|
done
|
2023-12-23 14:35:15 -05:00
|
|
|
|
|
|
|
|
for cfg in "/etc/kdumpst.d"/*; do
|
|
|
|
|
if [ -f "$cfg" ]; then
|
|
|
|
|
. "$cfg"
|
|
|
|
|
HAVE_CFG_FILES=1
|
|
|
|
|
fi
|
|
|
|
|
done
|
2022-12-01 12:12:42 -03:00
|
|
|
shopt -u nullglob
|
|
|
|
|
|
|
|
|
|
if [ ${HAVE_CFG_FILES} -eq 0 ]; then
|
2023-12-23 14:35:15 -05:00
|
|
|
logger "kdumpst: no config files in /usr/share/kdumpst.d/ or /etc/kdumpst.d/ - aborting."
|
2022-12-01 12:12:42 -03:00
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|