Project

General

Profile

Bug #9595 ยป ovpngwgroup.patch

patch file - James Webb, 06/19/2019 08:38 AM

View differences:

src/etc/inc/openvpn.inc
1575 1575
               log_error(gettext("Resyncing OpenVPN instances."));
1576 1576
       }
1577
       // Check if OpenVPN clients and servers are running on the correct interfaces.
1577 1578
       if (is_array($config['openvpn']['openvpn-server'])) {
1578 1579
               foreach ($config['openvpn']['openvpn-server'] as & $settings) {
1579
                       if ($interface <> "" && $interface != $settings['interface']) {
1580
                               continue;
1580
                       $mode_id = "server" . $settings['vpnid'];
1581
                       $fpath = "{$g['varetc_path']}/openvpn/{$mode_id}.interface";
1582
                       if (file_exists($fpath)) {
1583
                               if (trim(file_get_contents($fpath), " \t\n") != get_failover_interface($settings['interface'])) {
1584
                                       openvpn_resync('server', $settings);
1585
                               }
1581 1586
                       }
1582
                       openvpn_resync('server', $settings);
1583 1587
               }
1584 1588
       }
1585

  
1586 1589
       if (is_array($config['openvpn']['openvpn-client'])) {
1587 1590
               foreach ($config['openvpn']['openvpn-client'] as & $settings) {
1588
                       if ($interface <> "" && $interface != $settings['interface']) {
1589
                               continue;
1591
                       $mode_id = "client" . $settings['vpnid'];
1592
                       $fpath = "{$g['varetc_path']}/openvpn/{$mode_id}.interface";
1593
                       if (file_exists($fpath)) {
1594
                               if (trim(file_get_contents($fpath), " \t\n") != get_failover_interface($settings['interface'])) {
1595
                                       openvpn_resync('client', $settings);
1596
                               }
1590 1597
                       }
1591
                       openvpn_resync('client', $settings);
1592 1598
               }
1593 1599
       }
    (1-1/1)