mirror of
https://github.com/unraid/webgui.git
synced 2026-05-05 01:09:25 -05:00
minor code refracturing
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user