diff options
author | jim-p <jimp@pfsense.org> | 2012-06-26 14:07:13 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2012-06-26 14:07:13 -0400 |
commit | 53842a6c677ac718da26f20a097b40583b6f056b (patch) | |
tree | 68745d35f86980e38632bf145e4017f1b8eea9b0 /etc | |
parent | cf5f7d7e17b30d59aa44265fd300cb1a9a306e53 (diff) | |
download | pfsense-53842a6c677ac718da26f20a097b40583b6f056b.zip pfsense-53842a6c677ac718da26f20a097b40583b6f056b.tar.gz |
Add a small function to notify via remote methods only (smtp/growl). Notify when a dyndns IP changes.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/dyndns.class | 3 | ||||
-rw-r--r-- | etc/inc/notices.inc | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/etc/inc/dyndns.class b/etc/inc/dyndns.class index 9b97781..504dbf8 100644 --- a/etc/inc/dyndns.class +++ b/etc/inc/dyndns.class @@ -948,7 +948,8 @@ $wan_ip = $this->_checkIP(); conf_mount_rw(); if ($wan_ip > 0) { - $currentTime = time(); + $currentTime = time(); + notify_all_remote(sprintf(gettext("DynDNS updated IP Address on %s (%s) to %s"), convert_real_interface_to_friendly_descr($this->_if), $this->_if, $wan_ip)); log_error("phpDynDNS: updating cache file {$this->_cacheFile}: {$wan_ip}"); @file_put_contents($this->_cacheFile, "{$wan_ip}:{$currentTime}"); } else diff --git a/etc/inc/notices.inc b/etc/inc/notices.inc index b3084bc..284c077 100644 --- a/etc/inc/notices.inc +++ b/etc/inc/notices.inc @@ -393,4 +393,10 @@ function register_via_growl() { } } +/* Notify via remote methods only - not via GUI. */ +function notify_all_remote($msg) { + notify_via_smtp($msg); + notify_via_growl($msg); +} + ?> |