summaryrefslogtreecommitdiffstats
path: root/etc/rc.notify_message
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2010-07-30 19:32:48 -0400
committerScott Ullrich <sullrich@pfsense.org>2010-07-30 19:32:48 -0400
commitba90574464f7ab11b72d54f2085c92280c2c3258 (patch)
tree28495afffaff09eda7117477103679f45dd5cda6 /etc/rc.notify_message
parentd29d05ab8ee862f64120392778f0dc27b61eb7bf (diff)
downloadpfsense-ba90574464f7ab11b72d54f2085c92280c2c3258.zip
pfsense-ba90574464f7ab11b72d54f2085c92280c2c3258.tar.gz
Adding script to allow sending messages to growl or email from normal shell scripts. Options are -e for email, -g for growl and -m 'message to send'
Diffstat (limited to 'etc/rc.notify_message')
-rwxr-xr-xetc/rc.notify_message38
1 files changed, 38 insertions, 0 deletions
diff --git a/etc/rc.notify_message b/etc/rc.notify_message
new file mode 100755
index 0000000..a2c7d4b
--- /dev/null
+++ b/etc/rc.notify_message
@@ -0,0 +1,38 @@
+#!/usr/local/bin/php
+
+<?php
+
+require("config.inc");
+require("functions.inc");
+require("notices.inc");
+
+$arguments = getopt("e:g:m:");
+
+$send_email = false;
+$send_growl = false;
+$message = "";
+
+foreach($arguments as $item => $arg) {
+ switch($item) {
+ case "e":
+ $send_email = true;
+ break;
+ case "g":
+ $send_growl = true;
+ break;
+ case "m":
+ $message = $arg;
+ break;
+ }
+}
+
+if($message) {
+ if($send_email) {
+ notify_via_smtp($message);
+ }
+ if($send_growl) {
+ notify_via_growl($message);
+ }
+}
+
+?> \ No newline at end of file
OpenPOWER on IntegriCloud