From 614ca41e090ae4ade5df5aaa341c01992bd18137 Mon Sep 17 00:00:00 2001 From: James Webb Date: Sun, 1 Sep 2019 00:39:24 +0100 Subject: [PATCH] Add else clause for cases when OpenVPN interface file does not exist. - Prevents potential race condition at startup resulting in failure to start OpenVPN instances. - In cases where interface file is not present the openvpn_resync function handles a restart correctly. --- src/etc/inc/openvpn.inc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/etc/inc/openvpn.inc b/src/etc/inc/openvpn.inc index 174f44063e..e37fc3763e 100644 --- a/src/etc/inc/openvpn.inc +++ b/src/etc/inc/openvpn.inc @@ -1584,6 +1584,8 @@ function openvpn_resync_all($interface = "") { if (trim(file_get_contents($fpath), " \t\n") != get_failover_interface($settings['interface'])) { openvpn_resync('server', $settings); } + } else { + openvpn_resync('server', $settings); } } } @@ -1595,6 +1597,8 @@ function openvpn_resync_all($interface = "") { if (trim(file_get_contents($fpath), " \t\n") != get_failover_interface($settings['interface'])) { openvpn_resync('client', $settings); } + } else { + openvpn_resync('client', $settings); } } }