aboutsummaryrefslogtreecommitdiffstats
path: root/config/arpwatch.xml
diff options
context:
space:
mode:
Diffstat (limited to 'config/arpwatch.xml')
-rw-r--r--config/arpwatch.xml20
1 files changed, 13 insertions, 7 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();