summaryrefslogtreecommitdiffstats
path: root/src/etc/inc/gwlb.inc
diff options
context:
space:
mode:
authorNewEraCracker <neweracracker@gmail.com>2016-10-12 15:05:27 +0100
committerNewEraCracker <neweracracker@gmail.com>2016-10-12 15:08:59 +0100
commit54596b8867ff706acc1a7bf74c2db81851830f5d (patch)
tree2939a52c76349f16d0de0b0fb350e950fb94b7c4 /src/etc/inc/gwlb.inc
parent3154be54107e227f50385a535df84af2af4dee61 (diff)
downloadpfsense-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.
Diffstat (limited to 'src/etc/inc/gwlb.inc')
-rw-r--r--src/etc/inc/gwlb.inc20
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'])) {
OpenPOWER on IntegriCloud