summaryrefslogtreecommitdiffstats
path: root/etc/rc.openvpn
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2014-12-11 08:24:26 +0545
committerPhil Davis <phil.davis@inf.org>2014-12-11 08:24:26 +0545
commit04c0724ed8a173e02e3d2501576b4c49f8719590 (patch)
tree7e953e0bb54c02bd05c021cba32c49f9f59787f6 /etc/rc.openvpn
parent6346f188e1c48de0457c9b39b0a1807b04355969 (diff)
downloadpfsense-04c0724ed8a173e02e3d2501576b4c49f8719590.zip
pfsense-04c0724ed8a173e02e3d2501576b4c49f8719590.tar.gz
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.
Diffstat (limited to 'etc/rc.openvpn')
-rwxr-xr-xetc/rc.openvpn3
1 files changed, 2 insertions, 1 deletions
diff --git a/etc/rc.openvpn b/etc/rc.openvpn
index 086aa49..226ad49 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";
OpenPOWER on IntegriCloud