mirror of
https://github.com/unraid/webgui.git
synced 2026-05-03 00:09:27 -05:00
Nchan start/stop foundation
This commit is contained in:
@@ -1081,13 +1081,18 @@ foreach ($pages as $page) {
|
||||
if (count($pages)) {
|
||||
$running = file_exists($nchan_no) ? explode(',',file_get_contents($nchan_no)) : [];
|
||||
$start = array_diff($nchan, $running); // returns any new scripts to be started
|
||||
// update list of current running nchan scripts
|
||||
$running = array_merge($start,$running);
|
||||
// start nchan scripts per page
|
||||
foreach ($start as $script) exec("$nchan_go/$script &>/dev/null &");
|
||||
/*
|
||||
For the time being we don't stop the scripts, which allows multiple active browser sessions to work
|
||||
$stop = array_diff($running, $nchan); // returns any old scripts to be stopped
|
||||
// stop running nchan scripts
|
||||
foreach ($stop as $script) exec("pkill $script >/dev/null &");
|
||||
// start nchan scripts per page
|
||||
foreach ($start as $script) exec("$nchan_go/$script &>/dev/null &");
|
||||
// update list of current running nchan scripts
|
||||
$running = array_merge(array_diff($stop,$running),$nchan);
|
||||
*/
|
||||
if (count($running)) file_put_contents($nchan_no,implode(',',$running)); else @unlink($nchan_no);
|
||||
}
|
||||
unset($pages,$page,$pgs,$pg,$icon,$nchan,$running,$start,$stop);
|
||||
|
||||
Reference in New Issue
Block a user