]> johannes.truschnigg.info Git - sqm_lagthrottle/commitdiff
Make configuration file mandatory
authorJohannes Truschnigg <johannes@truschnigg.info>
Sat, 3 Sep 2022 19:39:10 +0000 (21:39 +0200)
committerJohannes Truschnigg <johannes@truschnigg.info>
Sat, 3 Sep 2022 19:39:10 +0000 (21:39 +0200)
sqm_lagthrottle.sh

index ade83ef57cf05659ae5ac8f2a817be91a5107925..dd2342324b69516301b20a04a77ce0febc3b6608 100755 (executable)
@@ -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}"