From cf67393db6d3598bcf8d8324101e2933b124b137 Mon Sep 17 00:00:00 2001 From: Gmer4Lfe Date: Sun, 16 Aug 2026 20:40:23 -0400 Subject: [PATCH] Read varaverk.cfg the way bash and the PHP side both read it, so a comment on the SCRIPTS_DIR line cannot disable cron suppression --- Plugin/unraid/run_job.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Plugin/unraid/run_job.sh b/Plugin/unraid/run_job.sh index 51f3f9b..9e4b696 100755 --- a/Plugin/unraid/run_job.sh +++ b/Plugin/unraid/run_job.sh @@ -103,7 +103,19 @@ if [[ "$MANUAL" == false && -f "$MANUAL_TS_FILE" ]]; then # Static schedules like "30 2 * * 0" run at their appointed time and are never suppressed. INTERVAL=0 _VV_CFG="/boot/config/plugins/varaverk/varaverk.cfg" - _SCRIPTS_DIR=$(grep -m1 '^SCRIPTS_DIR' "$_VV_CFG" 2>/dev/null | cut -d= -f2 | tr -d '"'"'" | tr -d '[:space:]') + # Sourced in a subshell rather than grep|cut|tr. varaverk.cfg is shell syntax, so this is + # how bash itself reads it, and it agrees with the PHP side — include/config.php uses + # parse_ini_file(), which already honours quoting and comments. + # + # The pattern this replaces was `cut -d= -f2 | tr -d '[:space:]'`, which keeps everything + # after the first `=` and then squeezes all whitespace out of it. One trailing comment on + # that line — SCRIPTS_DIR="/mnt/user/appdata/Varaverk" # appdata mode — and the value + # becomes a path with the comment welded onto it, schedule.json is never found, INTERVAL + # stays 0, and every manual run silently stops suppressing the next cron fire. It also + # matched a bare `^SCRIPTS_DIR` prefix, so a future SCRIPTS_DIRECTORY= would win the -m1. + # + # Subshell so nothing else the cfg defines leaks into this runner or the job it wraps. + _SCRIPTS_DIR=$( . "$_VV_CFG" >/dev/null 2>&1 || true; printf '%s' "${SCRIPTS_DIR:-}" ) SCHEDULE_FILE="${_SCRIPTS_DIR:-/boot/config/plugins/varaverk}/schedule.json" if [[ -f "$SCHEDULE_FILE" ]]; then CRON_EXPR=$(php -r "