minor code refracturing

This commit is contained in:
bergware
2025-02-17 11:48:48 +01:00
parent 68ca314a5b
commit db4e9a1fc1
3 changed files with 12 additions and 4 deletions
@@ -4,10 +4,14 @@ SERVICES="rpc nfsd ntpd nginx sshd avahidaemon samba"
# run & log functions
. /etc/rc.d/rc.runlog
queue(){
atq | grep -Pom1 '^\d+'
}
# delayed execution
sleep ${1:-1}
JOB=$(atq | grep -Pom1 '^\d+')
JOB=$(queue)
if [[ -n $JOB ]]; then
atrm $JOB 2>/dev/null
log "execute queued job $JOB"
+1 -1
View File
@@ -6,7 +6,7 @@ INET=/etc/inetd.conf
SERV=/etc/services
# read settings
[[ -e /boot/config/ident.cfg ]] && . <(/usr/bin/fromdos </boot/config/ident.cfg)
[[ -e /boot/config/ident.cfg ]] && . <(fromdos </boot/config/ident.cfg)
# preset default values
[[ -z $USE_TELNET ]] && USE_TELNET=no
@@ -3,7 +3,11 @@
# run & log functions
. /etc/rc.d/rc.runlog
JOB=$(atq | grep -Pom1 '^\d+')
queue(){
atq | grep -Pom1 '^\d+'
}
JOB=$(queue)
if [[ -n $JOB ]]; then
atrm $JOB 2>/dev/null
log "remove queued job $JOB"
@@ -12,5 +16,5 @@ else
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"
log "queue new job $(queue), wait for ${1:-1}s"
exit 0