From 04c0724ed8a173e02e3d2501576b4c49f8719590 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Thu, 11 Dec 2014 08:24:26 +0545 Subject: [PATCH] Improve check if no OpenVPN defined Alternate version of https://github.com/pfsense/pfsense/pull/1376 This version retains the is_array() checks and then only does the count() if the is_array() is true. Take whichever version you like. --- etc/rc.openvpn | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/etc/rc.openvpn b/etc/rc.openvpn index 086aa490bf..226ad49ae0 100755 --- a/etc/rc.openvpn +++ b/etc/rc.openvpn @@ -76,7 +76,8 @@ if (isset($_GET['interface'])) else $argument = trim($argv[1], " \n"); -if(is_array($config['openvpn']['openvpn-server']) || is_array($config['openvpn']['openvpn-client'])) { +if((is_array($config['openvpn']['openvpn-server']) && count($config['openvpn']['openvpn-server'])) || + (is_array($config['openvpn']['openvpn-client']) && count($config['openvpn']['openvpn-client']))) { if (empty($argument) || $argument == "all") { $argument = "all"; $log_text = "all";