diff options
author | jim-p <jimp@pfsense.org> | 2012-03-06 15:52:29 -0500 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2012-03-06 15:52:29 -0500 |
commit | 2156f02a8262f2b13f826b91bb0f3190c18042be (patch) | |
tree | 2b65e39ff580611420370971809033a38135ff41 /etc/rc.carpbackup | |
parent | 9ea0cb90a6f7685cd29f018895aefbb70e25a5d6 (diff) | |
download | pfsense-2156f02a8262f2b13f826b91bb0f3190c18042be.zip pfsense-2156f02a8262f2b13f826b91bb0f3190c18042be.tar.gz |
Only run if this is an array
Diffstat (limited to 'etc/rc.carpbackup')
-rwxr-xr-x | etc/rc.carpbackup | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/etc/rc.carpbackup b/etc/rc.carpbackup index 165dd9e..76cdfac 100755 --- a/etc/rc.carpbackup +++ b/etc/rc.carpbackup @@ -41,11 +41,14 @@ notify_via_growl($notificationmsg); /* Stop OpenVPN clients running on this VIP, since multiple active OpenVPN clients on a CARP cluster can be problematic. */ global $config; -foreach ($config['openvpn']['openvpn-client'] as $settings) { - if ($settings['interface'] == $argv[1]) { - log_error("Stopping OpenVPN instance on {$settings['interface']} because of transition to CARP backup."); - openvpn_restart('client', $settings); +if (is_array($config['openvpn']) && is_array($config['openvpn']['openvpn-client'])) { + foreach ($config['openvpn']['openvpn-client'] as $settings) { + if ($settings['interface'] == $argv[1]) { + log_error("Stopping OpenVPN instance on {$settings['interface']} because of transition to CARP backup."); + openvpn_restart('client', $settings); + } } } + ?>
\ No newline at end of file |