From 5f9d501f8f823902de7b5d0e05790b17e58410ec Mon Sep 17 00:00:00 2001 From: phildd Date: Fri, 24 Aug 2012 18:24:00 +0545 Subject: Fix arpwatch so selected interface happens first time See: http://forum.pfsense.org/index.php/topic,51007.0.html After selecting an interface for arpwatch, the first time you "save" the selection is written to the config file, but arpwatch.sh gets written with the previous value. arpwatch starts on some other interface. You have to press save twice. This fixes the problem - code as per the forum suggestion and it works nicely for me. --- config/arpwatch.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/config/arpwatch.xml b/config/arpwatch.xml index c88480bd..c9434075 100644 --- a/config/arpwatch.xml +++ b/config/arpwatch.xml @@ -92,7 +92,11 @@ conf_mount_rw(); config_lock(); $log_file = "/var/log/arp.dat"; - $int = $config['installedpackages']['arpwatch']['config'][0]['interface']; + if($_POST['interface'] != "") { + $int = $_POST['interface']; + } else { + $int = $config['installedpackages']['arpwatch']['config'][0]['interface']; + } $int = convert_friendly_interface_to_real_interface_name($int); $start = "touch {$log_file}\n"; $start .= "/usr/local/sbin/arpwatch -d -f {$log_file} -i {$int} > /var/log/arpwatch.reports 2>&1 &"; -- cgit v1.2.3