From 37287794df27000cff78667645e3182174a4798e Mon Sep 17 00:00:00 2001 From: pavel Date: Mon, 29 Dec 2025 11:09:24 +0200 Subject: [PATCH] 1109 --- files/rabbit-client.sh | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/files/rabbit-client.sh b/files/rabbit-client.sh index 299de8d..a70c5c0 100644 --- a/files/rabbit-client.sh +++ b/files/rabbit-client.sh @@ -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 / _) + 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="${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}")