mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Make 0 byte sized log files happy
This commit is contained in:
parent
7cf210f199
commit
330cbe3aa4
@ -752,10 +752,14 @@ function dump_clog($logfile, $tail, $withorig = true, $grepfor = "", $grepinvert
|
||||
if(is_array($grepinvert))
|
||||
foreach($grepinvert as $agrep)
|
||||
$grepline .= " | grep -v \"$agrep\"";
|
||||
if($config['system']['disablesyslogclog'])
|
||||
exec("cat {$logfile}{$grepline} | /usr/bin/tail {$sor} -n {$tail}", $logarr);
|
||||
else
|
||||
exec("/usr/sbin/fifolog_reader {$logfile}{$grepline} | /usr/bin/tail {$sor} -n {$tail}", $logarr);
|
||||
if(filesize("{$logfile}") == 0) {
|
||||
$logarr = array("Log file started.");
|
||||
} else {
|
||||
if($config['system']['disablesyslogclog'])
|
||||
exec("cat {$logfile}{$grepline} | /usr/bin/tail {$sor} -n {$tail}", $logarr);
|
||||
else
|
||||
exec("/usr/sbin/fifolog_reader {$logfile}{$grepline} | /usr/bin/tail {$sor} -n {$tail}", $logarr);
|
||||
}
|
||||
foreach ($logarr as $logent) {
|
||||
$logent = preg_split("/\s+/", $logent, 6);
|
||||
echo "<tr valign=\"top\">\n";
|
||||
@ -1089,4 +1093,4 @@ function add_package_tabs($tabgroup, & $tab_array) {
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
Loading…
Reference in New Issue
Block a user