From 504838113451d91e88142dd3216d0c914b6275da Mon Sep 17 00:00:00 2001 From: doktornotor Date: Sat, 8 Aug 2015 12:30:16 +0200 Subject: arpwatch - code style cleanup - Fix copyright header - Fix chmod - Remove obsolete pfSense version check - Code style cleanup --- config/arpwatch/arpwatch.xml | 75 ++++++++++++++++++++++++++------------------ 1 file changed, 44 insertions(+), 31 deletions(-) (limited to 'config') diff --git a/config/arpwatch/arpwatch.xml b/config/arpwatch/arpwatch.xml index a40422d4..820d397d 100644 --- a/config/arpwatch/arpwatch.xml +++ b/config/arpwatch/arpwatch.xml @@ -1,28 +1,30 @@ - - + + ARP Monitoring Daemon - None - Currently there are no FAQ items provided. arpwatch - 2.1.a14 pkg v1.1.1 + 1.1.2 arpwatch: Settings pkg_edit.php?xml=arpwatch.xml&id=0 @@ -71,12 +71,12 @@ installedpackages->package->$packagename->configuration->settings /usr/local/www/ - a+rx + 0755 https://packages.pfsense.org/packages/config/arpwatch/arpwatch_reports.php /usr/sbin/ - a+rx + 0755 https://packages.pfsense.org/packages/config/arpwatch/sm.php @@ -90,33 +90,45 @@ Enable E-mail Notifications enable_email checkbox - Sends an E-mail notification for each new station and ARP change as they are seen <strong>instead of</strong> local reports.<br/>NOTE: Only works on pfSense 2.1 or later. <br/>NOTE 2: Disables local reports which rely on arpwatch debug mode, which does not work with e-mail notifications.<br/>Configure SMTP and address settings in System > Advanced on the Notifications tab + + , instead of local reports.
+ NOTE: Disables local reports which rely on arpwatch debug mode, which does not work with e-mail notifications.
+ Configure SMTP and address settings in System - Advanced on the Notifications tab. + ]]> +
2.0) && (isset($_POST['enable_email']) || ($config['installedpackages']['arpwatch']['config'][0]['enable_email'] == "on"))) { - if (!empty($config['notifications']['smtp']['notifyemailaddress'])) + if (isset($_POST['enable_email']) || ($config['installedpackages']['arpwatch']['config'][0]['enable_email'] == "on")) { + if (!empty($config['notifications']['smtp']['notifyemailaddress'])) { $mail = " -m \"{$config['notifications']['smtp']['notifyemailaddress']}\""; + } } else { $debug = "-d"; } + + /* Listening interface setup */ + 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 {$debug} -f {$log_file} {$mail} -i {$int} > /var/log/arpwatch.reports 2>&1 &"; + + /* Create init script */ + $start = "/usr/bin/touch {$log_file}\n"; + $start .= "/usr/local/sbin/arpwatch {$debug} -f {$log_file} {$mail} -i {$int} > /var/log/arpwatch.reports 2>&1 &"; $stop = "/usr/bin/killall arpwatch"; write_rcfile(array( "file" => "arpwatch.sh", @@ -124,6 +136,7 @@ "stop" => $stop ) ); + restart_service("arpwatch"); conf_mount_ro(); config_unlock(); -- cgit v1.2.3