#!/usr/bin/php -q echo "
ErrorWarningSystemArrayLogin
\n"; require_once '/usr/local/emhttp/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>".htmlentities($line).""; flush(); } pclose($handle); ?>