From 4bfbfc40f1130bf787f91d5938bbde6a43223b6d Mon Sep 17 00:00:00 2001
From: zbchristian <33725910+zbchristian@users.noreply.github.com>
Date: Sat, 12 Jun 2021 16:19:31 +0200
Subject: [PATCH 4/5] Remove determination of the default config
---
 templates/openvpn/configs.php | 4 ----
 1 file changed, 4 deletions(-)
diff --git a/templates/openvpn/configs.php b/templates/openvpn/configs.php
index dad4a795..c3e578ee 100644
--- a/templates/openvpn/configs.php
+++ b/templates/openvpn/configs.php
@@ -7,10 +7,6 @@
           
openvpn-client service.") ?>
         
         
-          
           
Date: Sat, 12 Jun 2021 16:21:20 +0200
Subject: [PATCH 5/5] 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"
         )
     );
 }