1109
This commit is contained in:
@@ -109,8 +109,15 @@ dispatch_task() {
|
|||||||
local -a extra_nbplay_opts=()
|
local -a extra_nbplay_opts=()
|
||||||
local n=""
|
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
|
# 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]}"
|
base_task="${BASH_REMATCH[1]}"
|
||||||
|
|
||||||
# now, today 01:00, tomorrow 01:00 (local time)
|
# now, today 01:00, tomorrow 01:00 (local time)
|
||||||
@@ -131,21 +138,21 @@ dispatch_task() {
|
|||||||
|
|
||||||
extra_nbplay_opts+=("-erebootin=${total_h}")
|
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)"
|
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]}"
|
n="${BASH_REMATCH[1]}"
|
||||||
base_task="update-rebootin"
|
base_task="update-rebootin"
|
||||||
extra_nbplay_opts+=("-erebootin=${n}")
|
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]}"
|
n="${BASH_REMATCH[1]}"
|
||||||
base_task="update-reboot" # runs update-reboot.yml (wrapper -> update-rebootin222.yml)
|
base_task="update-reboot" # runs update-reboot.yml (wrapper -> update-rebootin222.yml)
|
||||||
extra_nbplay_opts+=("-erebootin=${n}")
|
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>
|
# CHANGED: keep same convention as others — pass HOURS directly via -e rebootin=<n>
|
||||||
n="${BASH_REMATCH[1]}"
|
n="${BASH_REMATCH[1]}"
|
||||||
base_task="update-indoor"
|
base_task="update-indoor"
|
||||||
extra_nbplay_opts+=("-erebootin=${n}")
|
extra_nbplay_opts+=("-erebootin=${n}")
|
||||||
log "Parsed update-indoor suffix: ${n}h (passed as -e rebootin=${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]}"
|
n="${BASH_REMATCH[1]}"
|
||||||
base_task="update-indoor-bootenv"
|
base_task="update-indoor-bootenv"
|
||||||
extra_nbplay_opts+=("-erebootin=${n}")
|
extra_nbplay_opts+=("-erebootin=${n}")
|
||||||
|
|||||||
Reference in New Issue
Block a user