Project

General

Profile

Download (1.83 KB) Statistics
| Branch: | Tag: | Revision:
1 cb7d18d5 Renato Botelho
#!/usr/local/bin/php-cgi
2 ba905744 Scott Ullrich
<?php
3 38b52836 Scott Ullrich
/*
4 e173dd74 Phil Davis
	rc.notify_message
5
	part of pfSense (https://www.pfsense.org)
6
	Copyright (C) 2010 Scott Ullrich <sullrich@gmail.com>
7
	All rights reserved.
8 38b52836 Scott Ullrich
9 e173dd74 Phil Davis
	Redistribution and use in source and binary forms, with or without
10
	modification, are permitted provided that the following conditions are met:
11 38b52836 Scott Ullrich
12 e173dd74 Phil Davis
	1. Redistributions of source code must retain the above copyright notice,
13
	   this list of conditions and the following disclaimer.
14 38b52836 Scott Ullrich
15 e173dd74 Phil Davis
	2. Redistributions in binary form must reproduce the above copyright
16
	   notice, this list of conditions and the following disclaimer in the
17
	   documentation and/or other materials provided with the distribution.
18 38b52836 Scott Ullrich
19 e173dd74 Phil Davis
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
20
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
21
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
23
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28
	POSSIBILITY OF SUCH DAMAGE.
29 38b52836 Scott Ullrich
*/
30 ba905744 Scott Ullrich
31 17c2c2fa Phil Davis
require_once("config.inc");
32
require_once("functions.inc");
33
require_once("notices.inc");
34 ba905744 Scott Ullrich
35 2f909e2e Warren Baker
$arguments = getopt("egm:");
36 ba905744 Scott Ullrich
37
$send_email = false;
38
$send_growl = false;
39
$message = "";
40
41 e173dd74 Phil Davis
foreach ($arguments as $item => $arg) {
42
	switch ($item) {
43 ba905744 Scott Ullrich
		case "e":
44
			$send_email = true;
45
			break;
46
		case "g":
47
			$send_growl = true;
48
			break;
49
		case "m":
50
			$message = $arg;
51
			break;
52
	}
53
}
54
55 e173dd74 Phil Davis
if ($message) {
56
	if ($send_email) {
57 ba905744 Scott Ullrich
		notify_via_smtp($message);
58
	}
59 e173dd74 Phil Davis
	if ($send_growl) {
60 ba905744 Scott Ullrich
		notify_via_growl($message);
61
	}
62
}
63
64 17c2c2fa Phil Davis
?>