]> johannes.truschnigg.info Git - sqm_lagthrottle/commitdiff
Reset PS4 to prevent potential unwanted xtrace effects
authorJohannes Truschnigg <johannes@truschnigg.info>
Sat, 3 Sep 2022 17:08:36 +0000 (19:08 +0200)
committerJohannes Truschnigg <johannes@truschnigg.info>
Sat, 3 Sep 2022 17:08:36 +0000 (19:08 +0200)
sqm_lagthrottle.sh

index fa970cbab7080690e34b490b80b3cb25f0145ef4..4ee6558d09853c7c83038b7e1496edd361379a40 100755 (executable)
@@ -103,6 +103,7 @@ done
 if [ -r "${SQML_CFGFILE}" ] && sh -n "${SQML_CFGFILE}"
 then
   printf '# INFO: Evaluating configuration file at "%s"...\n' "${SQML_CFGFILE}"
+  _ps4="${PS4}"
   eval "PS4='# CONFIG: ' set -x; $(grep -E '[A-Z][A-Z_]+=' "${SQML_CFGFILE}"); set +x"
   _cfg_ok=$?
   set +x
@@ -111,6 +112,7 @@ then
     printf 'FATAL: Configuration delta in "%s" could not be evaluated without errors."\n' >&2
     exit 1
   fi
+  PS4="${_ps4}"
 fi