aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorphildd <ict.advisor@nepal.inf.org>2012-08-24 18:07:31 +0545
committerphildd <ict.advisor@nepal.inf.org>2012-08-24 18:07:31 +0545
commit132e2e1c9f843d45740e13c3f6a5ab6c2203992e (patch)
treee1f19702fc822a1666cd48574b24303ba00bf2d1
parent41d16b6cd9e6a4fe4b8a2a811e4f53b35fa61784 (diff)
downloadpfsense-packages-132e2e1c9f843d45740e13c3f6a5ab6c2203992e.tar.gz
pfsense-packages-132e2e1c9f843d45740e13c3f6a5ab6c2203992e.tar.bz2
pfsense-packages-132e2e1c9f843d45740e13c3f6a5ab6c2203992e.zip
Make arpwatch work on 21 and nanobsd
On 2.1 arpwatch was putting its log file (arp.dat) into a "pbi" folder where it was installed. arpwatch_reports.php didn't know anything about that, so didn't find it. On nanobsd the usr pbi location is RO anyway. So, arp.dat moved to /var/log Some code added to touch the file from rc.d/arpwatch.sh - arpwatch complains if the file does not exist when it starts.
-rw-r--r--config/arpwatch.xml14
1 files changed, 8 insertions, 6 deletions
diff --git a/config/arpwatch.xml b/config/arpwatch.xml
index 0553eb58..c88480bd 100644
--- a/config/arpwatch.xml
+++ b/config/arpwatch.xml
@@ -89,11 +89,13 @@
<custom_php_global_functions>
function sync_package_arpwatch() {
global $config;
- conf_mount_rw();
- config_lock();
+ conf_mount_rw();
+ config_lock();
+ $log_file = "/var/log/arp.dat";
$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 +104,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();