diff options
author | Stephen Beaver <sbeaver@netgate.com> | 2015-09-10 08:09:23 -0400 |
---|---|---|
committer | Stephen Beaver <sbeaver@netgate.com> | 2015-09-10 08:09:23 -0400 |
commit | 6658142a6a570aef035207bf113f699269ebaa02 (patch) | |
tree | bcaf925f0fdbff16029683b3f569db229f7e9754 /src/etc/rc.carpbackup | |
parent | a46c437d0f86ee3c187f7a360394275417161a03 (diff) | |
download | pfsense-6658142a6a570aef035207bf113f699269ebaa02.zip pfsense-6658142a6a570aef035207bf113f699269ebaa02.tar.gz |
Minor edits to deal with a crash report. Don't "forwach" if the aray is not present.
Diffstat (limited to 'src/etc/rc.carpbackup')
-rwxr-xr-x | src/etc/rc.carpbackup | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/etc/rc.carpbackup b/src/etc/rc.carpbackup index 34fca29..04a1be5 100755 --- a/src/etc/rc.carpbackup +++ b/src/etc/rc.carpbackup @@ -50,12 +50,15 @@ $friendly = convert_real_interface_to_friendly_interface_name($iface); $friendly_descr = convert_friendly_interface_to_friendly_descr($friendly); $vips = link_interface_to_vips($friendly, '', $vhid); $carp_iface = "{$friendly}_vip{$vhid}"; -foreach ($vips as $vip) { - $notificationmsg = sprintf('Carp cluster member "{$friendly_descr)(%2$s): {$vip["subnet"]} (%1$s)" has resumed the state "BACKUP" for vhid %s', $argument, $vip['descr'], $vhid); - notify_via_smtp($notificationmsg); - notify_via_growl($notificationmsg); - log_error($notificationmsg); +if(is_array($vips) { + foreach ($vips as $vip) { + $notificationmsg = sprintf('Carp cluster member "{$friendly_descr)(%2$s): {$vip["subnet"]} (%1$s)" has resumed the state "BACKUP" for vhid %s', $argument, $vip['descr'], $vhid); + + notify_via_smtp($notificationmsg); + notify_via_growl($notificationmsg); + log_error($notificationmsg); + } } /* Stop OpenVPN clients running on this VIP, since multiple active OpenVPN clients on a CARP cluster can be problematic. */ |