This commit is contained in:
2025-12-29 11:09:24 +02:00
parent 81a4e9ea78
commit 37287794df

View File

@@ -109,8 +109,15 @@ dispatch_task() {
local -a extra_nbplay_opts=()
local n=""
# NEW: allow trailing "_force" suffix (can be combined with other suffixes like _tonight / _<hours>)
if [[ "$base_task" =~ ^(.+)_force$ ]]; then
base_task="${BASH_REMATCH[1]}"
extra_nbplay_opts+=("-eforce=true")
log "Parsed _force suffix: base='${base_task}' (passed as -e force=true)"
fi
# NEW: generic *_tonight → compute hours until next 01:00 (ceil) + random 1..4
if [[ "$task" =~ ^(.+)_tonight$ ]]; then
if [[ "$base_task" =~ ^(.+)_tonight$ ]]; then
base_task="${BASH_REMATCH[1]}"
# now, today 01:00, tomorrow 01:00 (local time)
@@ -131,21 +138,21 @@ dispatch_task() {
extra_nbplay_opts+=("-erebootin=${total_h}")
log "Resolved '${task}' → base='${base_task}', rebootin=${total_h}h (ceil_to_1am=${ceil_h}h + rand=${rnd}h)"
elif [[ "$task" =~ ^update-rebootin_([0-9]{1,2})$ ]]; then
elif [[ "$base_task" =~ ^update-rebootin_([0-9]{1,2})$ ]]; then
n="${BASH_REMATCH[1]}"
base_task="update-rebootin"
extra_nbplay_opts+=("-erebootin=${n}")
elif [[ "$task" =~ ^update-reboot_([0-9]{1,4})$ ]]; then
elif [[ "$base_task" =~ ^update-reboot_([0-9]{1,4})$ ]]; then
n="${BASH_REMATCH[1]}"
base_task="update-reboot" # runs update-reboot.yml (wrapper -> update-rebootin222.yml)
extra_nbplay_opts+=("-erebootin=${n}")
elif [[ "$task" =~ ^update-indoor_([0-9]{1,4})$ ]]; then
elif [[ "$base_task" =~ ^update-indoor_([0-9]{1,4})$ ]]; then
# CHANGED: keep same convention as others — pass HOURS directly via -e rebootin=<n>
n="${BASH_REMATCH[1]}"
base_task="update-indoor"
extra_nbplay_opts+=("-erebootin=${n}")
log "Parsed update-indoor suffix: ${n}h (passed as -e rebootin=${n})"
elif [[ "$task" =~ ^update-indoor-bootenv_([0-9]{1,4})$ ]]; then
elif [[ "$base_task" =~ ^update-indoor-bootenv_([0-9]{1,4})$ ]]; then
n="${BASH_REMATCH[1]}"
base_task="update-indoor-bootenv"
extra_nbplay_opts+=("-erebootin=${n}")