mirror of
https://github.com/unraid/webgui.git
synced 2026-02-25 03:38:44 -06:00
Put update requests in a job queue and replace the job queue when new update requests are presented within the scheduled wait time This approach makes only the last update request running New log entries are provided to follow execution of the jobs
17 lines
367 B
Bash
Executable File
17 lines
367 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# run & log functions
|
|
. /etc/rc.d/rc.runlog
|
|
|
|
JOB=$(atq | grep -Pom1 '^\d+')
|
|
if [[ -n $JOB ]]; then
|
|
atrm $JOB 2>/dev/null
|
|
log "remove queued job $JOB"
|
|
else
|
|
log "no queued job present"
|
|
fi
|
|
|
|
echo "/usr/local/emhttp/webGui/scripts/reload_services ${1:-1}" | at -M now 2>/dev/null
|
|
log "queue new job $(atq | grep -Pom1 '^\d+'), wait for ${1:-1}s"
|
|
exit 0
|