Files
webgui/emhttp/plugins/dynamix/scripts/reload_services
2025-02-17 11:48:48 +01:00

26 lines
371 B
Bash
Executable File

#!/bin/bash
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=$(queue)
if [[ -n $JOB ]]; then
atrm $JOB 2>/dev/null
log "execute queued job $JOB"
else
exit 0
fi
for cmd in $SERVICES; do
/etc/rc.d/rc.$cmd update &>/dev/null
done
exit 0