diff options
-rwxr-xr-x | etc/rc.carpbackup | 11 | ||||
-rwxr-xr-x | etc/rc.carpmaster | 10 |
2 files changed, 13 insertions, 8 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 diff --git a/etc/rc.carpmaster b/etc/rc.carpmaster index aaac868..cb5395e 100755 --- a/etc/rc.carpmaster +++ b/etc/rc.carpmaster @@ -41,10 +41,12 @@ notify_via_growl($notificationmsg); /* Start OpenVPN clients running on this VIP, since they should be in the stopped state while the VIP is CARP Backup. */ global $config; -foreach ($config['openvpn']['openvpn-client'] as $settings) { - if ($settings['interface'] == $argv[1]) { - log_error("Starting OpenVPN instance on {$settings['interface']} because of transition to CARP master."); - 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("Starting OpenVPN instance on {$settings['interface']} because of transition to CARP master."); + openvpn_restart('client', $settings); + } } } |