diff options
author | NewEraCracker <neweracracker@gmail.com> | 2016-10-12 15:05:27 +0100 |
---|---|---|
committer | NewEraCracker <neweracracker@gmail.com> | 2016-10-12 15:08:59 +0100 |
commit | 54596b8867ff706acc1a7bf74c2db81851830f5d (patch) | |
tree | 2939a52c76349f16d0de0b0fb350e950fb94b7c4 | |
parent | 3154be54107e227f50385a535df84af2af4dee61 (diff) | |
download | pfsense-54596b8867ff706acc1a7bf74c2db81851830f5d.zip pfsense-54596b8867ff706acc1a7bf74c2db81851830f5d.tar.gz |
Improve gwlb.inc notification mechanisms
1) Unlink earlier to reduce the chances of any concurrency issues;
2) Translate and improve output of available notification;
3) While I'm here, fix whitespace and improve PHP syntax.
-rw-r--r-- | src/etc/inc/gwlb.inc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/etc/inc/gwlb.inc b/src/etc/inc/gwlb.inc index f1d5e3b..06e6997 100644 --- a/src/etc/inc/gwlb.inc +++ b/src/etc/inc/gwlb.inc @@ -923,26 +923,26 @@ function return_gateway_groups_array() { $gwdown = true; } if ($gwdown == true) { - if (!file_exists("/tmp/.down.$gwname")) { - $msg .= "\n".implode("|", $status); - touch("/tmp/.down.$gwname"); - log_error($msg); - notify_via_growl($msg); - notify_via_smtp($msg); - } + if (!file_exists("/tmp/.down.{$gwname}")) { + $msg .= "\n".implode("|", $status); + touch("/tmp/.down.{$gwname}"); + log_error($msg); + notify_via_growl($msg); + notify_via_smtp($msg); + } } else { /* Online add member */ if (!is_array($tiers[$tier])) { $tiers[$tier] = array(); } $tiers[$tier][] = $gwname; - if (file_exists("/tmp/.down.$gwname")) { - $msg = "MONITOR: {$gwname} is available now, adding to routing group"; + if (file_exists("/tmp/.down.{$gwname}")) { + $msg = sprintf(gettext('MONITOR: %1$s is available now, adding to routing group %2$s'), $gwname, $group['name']); $msg .= "\n".implode("|", $status); + unlink("/tmp/.down.{$gwname}"); log_error($msg); notify_via_growl($msg); notify_via_smtp($msg); - unlink("/tmp/.down.$gwname"); } } } else if (isset($gateways_arr[$gwname]['monitor_disable'])) { |