diff options
author | Colin Smith <colin@pfsense.org> | 2005-09-11 22:18:05 +0000 |
---|---|---|
committer | Colin Smith <colin@pfsense.org> | 2005-09-11 22:18:05 +0000 |
commit | 1ba738af6a6a20db1c0a56ffbd2de57914747984 (patch) | |
tree | bfae32868901597b848554e48308e2b44200f363 /packages | |
parent | a75708bc4ae0fdc40b4c9bb68a65b927fd33bdc2 (diff) | |
download | pfsense-packages-1ba738af6a6a20db1c0a56ffbd2de57914747984.tar.gz pfsense-packages-1ba738af6a6a20db1c0a56ffbd2de57914747984.tar.bz2 pfsense-packages-1ba738af6a6a20db1c0a56ffbd2de57914747984.zip |
A few more minor bugfixes.
Diffstat (limited to 'packages')
-rwxr-xr-x | packages/arpwatch_reports.php | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/packages/arpwatch_reports.php b/packages/arpwatch_reports.php index 709035ea..b39fb9fb 100755 --- a/packages/arpwatch_reports.php +++ b/packages/arpwatch_reports.php @@ -36,17 +36,20 @@ $logfile = "/usr/local/arpwatch/arp.dat"; if ($_POST['clear']) { stop_service("arpwatch"); unlink_if_exists($logfile); + touch($logfile); start_service("arpwatch"); } -$rawrep = file($logfile); -foreach($rawrep as $line) { - $todo = preg_split('/\s/', $line); - $report[$todo[1]][] = array( - "mac" => trim($todo[0]), - "timestamp" => trim($todo[2]), - "hostname" => trim($todo[3]) ? trim($todo[3]) : "Unknown" - ); +if(file_exists($logfile)) { + $rawrep = file($logfile); + foreach($rawrep as $line) { + $todo = preg_split('/\s/', $line); + $report[$todo[1]][] = array( + "mac" => trim($todo[0]), + "timestamp" => trim($todo[2]), + "hostname" => trim($todo[3]) ? trim($todo[3]) : "Unknown" + ); + } } $pgtitle = "arpwatch: Reports"; include("head.inc"); @@ -108,7 +111,7 @@ include("head.inc"); <tr> <td> <br> - <form action="diag_logs.php" method="post"> + <form action="arpwatch_reports.php" method="post"> <input name="clear" type="submit" class="formbtn" value="Clear log"> </form> </td> |