summaryrefslogtreecommitdiffstats
path: root/etc/rc.carpbackup
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2012-03-06 15:52:29 -0500
committerjim-p <jimp@pfsense.org>2012-03-06 15:53:03 -0500
commitb06dc19616f31d1b4cffc6241dc20eab2b8335bb (patch)
treee0138325a65ff579d208385934b7457f3fc61110 /etc/rc.carpbackup
parenta4271d123439e022b92a522c32fd70f3feeece3f (diff)
downloadpfsense-b06dc19616f31d1b4cffc6241dc20eab2b8335bb.zip
pfsense-b06dc19616f31d1b4cffc6241dc20eab2b8335bb.tar.gz
Only run if this is an array
Diffstat (limited to 'etc/rc.carpbackup')
-rwxr-xr-xetc/rc.carpbackup11
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
OpenPOWER on IntegriCloud