Commit 8c32e798 authored by Franco Fichtner's avatar Franco Fichtner

openvpn/ipsec: properly handle interface deletion artefact

The array was still there, and even though empty evaluated as
being filled with data that requires an interface.
parent 47c3fee7
......@@ -64,8 +64,7 @@ function if_ipsec_interfaces()
$interfaces = array();
/* add ipsec interfaces */
if (isset($config['ipsec']['enable']) || isset($config['ipsec']['client']['enable'])) {
if (isset($config['ipsec']['phase1']) && count($config['ipsec']['phase1'])) {
$oic = array("enable" => true);
$oic['if'] = 'enc0';
$oic['descr'] = 'IPsec';
......
......@@ -73,8 +73,8 @@ function if_openvpn_interfaces()
$interfaces = array();
/* add openvpn interfaces */
if (isset($config['openvpn']['openvpn-server']) || isset($config['openvpn']['openvpn-client'])) {
if ((isset($config['openvpn']['openvpn-server']) && count($config['openvpn']['openvpn-server'])) ||
(isset($config['openvpn']['openvpn-client']) && count($config['openvpn']['openvpn-client']))) {
$oic = array("enable" => true);
$oic['if'] = "openvpn";
$oic['descr'] = 'OpenVPN';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment