From 4c79f1f362ae54103a40e2888b31bcb4ae93b56d Mon Sep 17 00:00:00 2001 From: zbchristian <33725910+zbchristian@users.noreply.github.com> Date: Sat, 12 Jun 2021 16:21:20 +0200 Subject: [PATCH] Insert determination of the default config --- includes/openvpn.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/includes/openvpn.php b/includes/openvpn.php index 711c1c45..67084df4 100755 --- a/includes/openvpn.php +++ b/includes/openvpn.php @@ -54,6 +54,8 @@ function DisplayOpenVPNConfig() $authPassword = next($auth); } $clients = preg_grep('/_client.(conf)$/', scandir(pathinfo(RASPI_OPENVPN_CLIENT_CONFIG, PATHINFO_DIRNAME))); + exec("readlink ".RASPI_OPENVPN_CLIENT_CONFIG." | xargs basename", $ret); + $conf_default = empty($ret) ? "none" : $ret[0]; $logEnable = 0; if (!empty($_POST) && !isset($_POST['log-openvpn'])) { @@ -79,7 +81,8 @@ function DisplayOpenVPNConfig() "public_ip", "authUser", "authPassword", - "clients" + "clients", + "conf_default" ) ); }