diff options
author | Ermal <eri@pfsense.org> | 2013-04-12 19:36:24 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2013-04-12 19:36:24 +0000 |
commit | c653ce27d076878f1ef342a6da8d3d3f8a67b021 (patch) | |
tree | d7ae0fb3e892cb1d540bc00e1bd80a8603960ca1 | |
parent | 58b1112f207ec178f5432bd2849f3985a9040b14 (diff) | |
download | pfsense-c653ce27d076878f1ef342a6da8d3d3f8a67b021.zip pfsense-c653ce27d076878f1ef342a6da8d3d3f8a67b021.tar.gz |
Support even openvpn specifying a gateway group on the interface
-rwxr-xr-x | etc/rc.openvpn | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/etc/rc.openvpn b/etc/rc.openvpn index fc86177..3f6af1f 100755 --- a/etc/rc.openvpn +++ b/etc/rc.openvpn @@ -48,7 +48,8 @@ if(isset($config['openvpn']['enable'])) log_error("OpenVPN: One or more OpenVPN tunnel endpoints may have changed its IP. Reloading."); else return; - + +$gwgroups = array(); $openvpnlck = lock('openvpn', LOCK_EX); if (empty($argument) || $argument == "all") $interface = ""; @@ -56,18 +57,20 @@ else { $interface = lookup_gateway_interface_by_name($argument); if (empty($interface)) $interface = $argument; + else + $gwgroups = gateway_is_gwgroup_member($argument); } if(is_array($config['openvpn']['openvpn-server'])) { foreach($config['openvpn']['openvpn-server'] as &$server) { - if ($server['interface'] == $interface || empty($interface)) + if ($server['interface'] == $interface || empty($interface) || (!empty($gwgroups) && in_array($argument, $gwgroups))) openvpn_resync('server', $server); } } if (is_array($config['openvpn']['openvpn-client'])) { foreach($config['openvpn']['openvpn-client'] as &$client) { - if ($client['interface'] == $interface || empty($interface)) + if ($client['interface'] == $interface || empty($interface) || (!empty($gwgroups) && in_array($argument, $gwgroups))) openvpn_resync('client', $client); } } |