Nchan foundation

This commit is contained in:
bergware
2021-06-23 14:39:12 +02:00
parent a61b6b7afe
commit fe3d2b8b22
2 changed files with 5 additions and 5 deletions

View File

@@ -58,7 +58,7 @@ html{font-size:<?=$display['font']?>}
.upgrade_notice i{margin:14px;float:right;cursor:pointer}
.back_to_top{display:none;position:fixed;bottom:30px;right:12px;color:#e22828;font-size:2.5rem;z-index:999}
<?
$nchan = ["$docroot/webGui/nchan/notify_poller","$docroot/webGui/nchan/session_check"];
$nchan = ['webGui/nchan/notify_poller','webGui/nchan/session_check'];
$safemode = $var['safeMode']=='yes';
$tasks = find_pages('Tasks');
$buttons = find_pages('Buttons');
@@ -512,13 +512,13 @@ if (count($pages)) {
// start nchan scripts which are new
foreach ($start as $row) {
$script = explode(':',$row)[0];
exec("$script &>/dev/null &");
exec("$docroot/$script &>/dev/null &");
}
// stop nchan scripts with the :stop option
foreach ($stop as $row) {
[$script,$opt] = my_explode(':',$row);
if ($opt == 'stop') {
exec("pkill -f $script >/dev/null &");
exec("pkill -f $docroot/$script >/dev/null &");
array_splice($running,array_search($row,$running),1);
}
}

View File

@@ -16,8 +16,8 @@ session_start();
// Register Nchan scripts
function nchan_merge($root, $script) {
global $docroot, $nchan_run, $nchan;
$nchan_run = "$docroot/$root/nchan";
global $nchan_run, $nchan;
$nchan_run = "$root/nchan";
$nchan = array_merge($nchan, array_map(function($n){global $nchan_run; return "$nchan_run/$n";}, explode(',',$script)));
}