Revision c653ce27
Added by Ermal LUÇI over 12 years ago
etc/rc.openvpn | ||
---|---|---|
48 | 48 |
log_error("OpenVPN: One or more OpenVPN tunnel endpoints may have changed its IP. Reloading."); |
49 | 49 |
else |
50 | 50 |
return; |
51 |
|
|
51 |
|
|
52 |
$gwgroups = array(); |
|
52 | 53 |
$openvpnlck = lock('openvpn', LOCK_EX); |
53 | 54 |
if (empty($argument) || $argument == "all") |
54 | 55 |
$interface = ""; |
... | ... | |
56 | 57 |
$interface = lookup_gateway_interface_by_name($argument); |
57 | 58 |
if (empty($interface)) |
58 | 59 |
$interface = $argument; |
60 |
else |
|
61 |
$gwgroups = gateway_is_gwgroup_member($argument); |
|
59 | 62 |
} |
60 | 63 |
|
61 | 64 |
if(is_array($config['openvpn']['openvpn-server'])) { |
62 | 65 |
foreach($config['openvpn']['openvpn-server'] as &$server) { |
63 |
if ($server['interface'] == $interface || empty($interface)) |
|
66 |
if ($server['interface'] == $interface || empty($interface) || (!empty($gwgroups) && in_array($argument, $gwgroups)))
|
|
64 | 67 |
openvpn_resync('server', $server); |
65 | 68 |
} |
66 | 69 |
} |
67 | 70 |
|
68 | 71 |
if (is_array($config['openvpn']['openvpn-client'])) { |
69 | 72 |
foreach($config['openvpn']['openvpn-client'] as &$client) { |
70 |
if ($client['interface'] == $interface || empty($interface)) |
|
73 |
if ($client['interface'] == $interface || empty($interface) || (!empty($gwgroups) && in_array($argument, $gwgroups)))
|
|
71 | 74 |
openvpn_resync('client', $client); |
72 | 75 |
} |
73 | 76 |
} |
Also available in: Unified diff
Support even openvpn specifying a gateway group on the interface