From 990db6702babfd19e4d5488ba8d77bb7a90f7ee6 Mon Sep 17 00:00:00 2001 From: Johannes Truschnigg Date: Sat, 3 Sep 2022 21:39:10 +0200 Subject: [PATCH] Make configuration file mandatory --- sqm_lagthrottle.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sqm_lagthrottle.sh b/sqm_lagthrottle.sh index ade83ef..dd23423 100755 --- a/sqm_lagthrottle.sh +++ b/sqm_lagthrottle.sh @@ -100,7 +100,13 @@ do done -if [ -r "${SQML_CFGFILE}" ] && sh -n "${SQML_CFGFILE}" +if ! [ -r "${SQML_CFGFILE}" ] +then + printf 'FATAL: Required configuration file "%s" cannot be read.\n' "${SQML_CFGFILE}" >&2 + exit 1 +fi + +if sh -n "${SQML_CFGFILE}" then printf '# INFO: Evaluating configuration file at "%s"...\n' "${SQML_CFGFILE}" _ps4="${PS4}" -- 2.39.5