From 81db069626303f4628534659739910e8852d8a90 Mon Sep 17 00:00:00 2001 From: billz Date: Sun, 17 Nov 2019 12:00:30 +0000 Subject: [PATCH] Resolve public_ip --- includes/openvpn.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/includes/openvpn.php b/includes/openvpn.php index 5a46998f..d69f7d67 100755 --- a/includes/openvpn.php +++ b/includes/openvpn.php @@ -43,10 +43,12 @@ function DisplayOpenVPNConfig() } } - $auth = file(RASPI_OPENVPN_CLIENT_LOGIN, FILE_IGNORE_NEW_LINES); exec('pidof openvpn | wc -l', $openvpnstatus); + exec('wget https://ipinfo.io/ip -qO -', $return); $serviceStatus = $openvpnstatus[0] == 0 ? "down" : "up"; + $auth = file(RASPI_OPENVPN_CLIENT_LOGIN, FILE_IGNORE_NEW_LINES); + $public_ip = $return[0]; // parse client auth credentials if (!empty($auth)) { @@ -58,6 +60,7 @@ function DisplayOpenVPNConfig() "status", "serviceStatus", "openvpnstatus", + "public_ip", "authUser", "authPassword" ));