diff options
author | Renato Botelho <renato@netgate.com> | 2015-08-11 07:44:26 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2015-08-11 07:44:26 -0300 |
commit | 47c10977ccd6440e228d19e7f14d749e1e3adddc (patch) | |
tree | 03fc1a9172c9ab42f370eb16d7ae22454834be59 /config/arpwatch/sm.php | |
parent | 268764e87ab8d2371542d8676f3bec3a4d436ce4 (diff) | |
parent | 3293747df8c455a8e31d81d059694a7a5a1e498d (diff) | |
download | pfsense-packages-47c10977ccd6440e228d19e7f14d749e1e3adddc.tar.gz pfsense-packages-47c10977ccd6440e228d19e7f14d749e1e3adddc.tar.bz2 pfsense-packages-47c10977ccd6440e228d19e7f14d749e1e3adddc.zip |
Merge pull request #958 from doktornotor/patch-2
Diffstat (limited to 'config/arpwatch/sm.php')
-rw-r--r-- | config/arpwatch/sm.php | 54 |
1 files changed, 36 insertions, 18 deletions
diff --git a/config/arpwatch/sm.php b/config/arpwatch/sm.php index 2e1cc4a0..4df6cead 100644 --- a/config/arpwatch/sm.php +++ b/config/arpwatch/sm.php @@ -1,33 +1,49 @@ #!/usr/local/bin/php -q <?php +/* + sm.php + part of pfSense (https://www.pfSense.org/) + Copyright (C) 2015 ESF, LLC + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ require_once("config.inc"); require_once("globals.inc"); require_once("notices.inc"); -$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); -if (($pf_version < 2.1)) { - $error = "Sending e-mail on this version of pfSense is not supported. Please use pfSense 2.1 or later"; - log_error($error); - echo "{$error}\n"; - return; -} - $options = getopt("s::"); - $message = ""; -if($options['s'] <> "") { +if ($options['s'] <> "") { $subject = $options['s']; } - $in = file("php://stdin"); -foreach($in as $line){ +foreach ($in as $line) { $line = trim($line); - if ( (substr($line, 0, 6) == "From: ") - || (substr($line, 0, 6) == "Date: ") - || (substr($line, 0, 4) == "To: ")) + if ((substr($line, 0, 6) == "From: ") || (substr($line, 0, 6) == "Date: ") || (substr($line, 0, 4) == "To: ")) { continue; + } if (empty($subject) && (substr($line, 0, 9) == "Subject: ")) { $subject = substr($line, 9); continue; @@ -35,8 +51,10 @@ foreach($in as $line){ $message .= "$line\n"; } -if (!empty($subject)) +if (!empty($subject)) { send_smtp_message($message, $subject); -else +} else { send_smtp_message($message); -?>
\ No newline at end of file +} + +?> |