#!/usr/bin/php -q ErrorWarningSystemArrayLogin

\n"; $docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'; require_once "$docroot/webGui/include/ColorCoding.php"; $handle = popen('/usr/bin/tail -n 40 -f '.escapeshellarg("/var/log/{$argv[1]}").' 2>&1', 'r'); while (!feof($handle)) { $line = fgets($handle); if (strpos($line,'tail_log')!==false) continue; $span = "span"; foreach ($match as $type) foreach ($type['text'] as $text) if (preg_match("/$text/i",$line)) {$span = "span class='{$type['class']}'"; break 2;} echo "<$span>".htmlspecialchars($line).""; flush(); } pclose($handle); ?>