diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2010-07-30 19:32:48 -0400 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2010-07-30 19:32:48 -0400 |
commit | ba90574464f7ab11b72d54f2085c92280c2c3258 (patch) | |
tree | 28495afffaff09eda7117477103679f45dd5cda6 | |
parent | d29d05ab8ee862f64120392778f0dc27b61eb7bf (diff) | |
download | pfsense-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'
-rwxr-xr-x | etc/rc.notify_message | 38 |
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 |