mirror of
https://github.com/unraid/webgui.git
synced 2026-01-07 01:59:52 -06:00
Update monitor_nchan
This commit is contained in:
@@ -5,9 +5,6 @@ disk_load=/var/local/emhttp/diskload.ini # disk load statistics
|
||||
nginx=/var/run/nginx.socket # nginx local access
|
||||
status=http://localhost/pub/session?buffer_length=1 # nchan information about GUI subscribers
|
||||
|
||||
# run & log functions
|
||||
. /etc/rc.d/rc.runlog
|
||||
|
||||
while :; do
|
||||
# only act when GUI registered nchan processes are running
|
||||
if [[ -e $nchan_pid ]]; then
|
||||
@@ -18,7 +15,7 @@ while :; do
|
||||
# steady state?
|
||||
subs=$(curl --unix-socket $nginx $status 2>/dev/null|grep -Pom1 'subscribers: \K\d+')
|
||||
if [[ -z $subs || $subs -eq 0 ]]; then
|
||||
log "Stop running nchan processes"
|
||||
logger -t monitor_nchan -- "Stop running nchan processes"
|
||||
# kill GUI registered nchan processes
|
||||
while IFS=$'\n' read -r running; do
|
||||
pkill -f $docroot/${running/:stop/}
|
||||
|
||||
Reference in New Issue
Block a user