aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorJim P <jim@pingle.org>2012-08-24 05:52:56 -0700
committerJim P <jim@pingle.org>2012-08-24 05:52:56 -0700
commite89115887c927e49bf0bc0814b823a74663f4a80 (patch)
tree7a5775983c53d36e782ac0a7f6c9bead4703b2ea /config
parent41d16b6cd9e6a4fe4b8a2a811e4f53b35fa61784 (diff)
parent5f9d501f8f823902de7b5d0e05790b17e58410ec (diff)
downloadpfsense-packages-e89115887c927e49bf0bc0814b823a74663f4a80.tar.gz
pfsense-packages-e89115887c927e49bf0bc0814b823a74663f4a80.tar.bz2
pfsense-packages-e89115887c927e49bf0bc0814b823a74663f4a80.zip
Merge pull request #313 from phildd/master
arpwatch fixes from forum and for 2.1
Diffstat (limited to 'config')
-rw-r--r--config/arpwatch.xml20
-rwxr-xr-xconfig/arpwatch_reports.php4
2 files changed, 15 insertions, 9 deletions
diff --git a/config/arpwatch.xml b/config/arpwatch.xml
index 0553eb58..c9434075 100644
--- a/config/arpwatch.xml
+++ b/config/arpwatch.xml
@@ -89,11 +89,17 @@
<custom_php_global_functions>
function sync_package_arpwatch() {
global $config;
- conf_mount_rw();
- config_lock();
- $int = $config['installedpackages']['arpwatch']['config'][0]['interface'];
+ conf_mount_rw();
+ config_lock();
+ $log_file = "/var/log/arp.dat";
+ if($_POST['interface'] != "") {
+ $int = $_POST['interface'];
+ } else {
+ $int = $config['installedpackages']['arpwatch']['config'][0]['interface'];
+ }
$int = convert_friendly_interface_to_real_interface_name($int);
- $start = "/usr/local/sbin/arpwatch -d -i {$int} > /var/log/arpwatch.reports 2>&amp;1 &amp;";
+ $start = "touch {$log_file}\n";
+ $start .= "/usr/local/sbin/arpwatch -d -f {$log_file} -i {$int} > /var/log/arpwatch.reports 2>&amp;1 &amp;";
$stop = "/usr/bin/killall arpwatch";
write_rcfile(array(
"file" => "arpwatch.sh",
@@ -102,9 +108,9 @@
)
);
restart_service("arpwatch");
- conf_mount_ro();
- config_unlock();
- }
+ conf_mount_ro();
+ config_unlock();
+ }
</custom_php_global_functions>
<custom_add_php_command>
sync_package_arpwatch();
diff --git a/config/arpwatch_reports.php b/config/arpwatch_reports.php
index 1bdb5233..d66b1a46 100755
--- a/config/arpwatch_reports.php
+++ b/config/arpwatch_reports.php
@@ -3,7 +3,7 @@
/*
$Id$
- diag_logs.php
+ arpwatch_reports.php
Copyright (C) 2005 Colin Smith
All rights reserved.
@@ -31,7 +31,7 @@
require("guiconfig.inc");
-$logfile = "/usr/local/arpwatch/arp.dat";
+$logfile = "/var/log/arp.dat";
if ($_POST['clear']) {
stop_service("arpwatch");