mirror of
https://github.com/billz/raspap-webgui.git
synced 2025-03-01 10:31:47 +00:00
Templatized OpenVPN config
This commit is contained in:
37
includes/openvpn.php
Normal file
37
includes/openvpn.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
include_once('includes/status_messages.php');
|
||||
|
||||
/**
|
||||
*
|
||||
* Manage OpenVPN configuration
|
||||
*
|
||||
*/
|
||||
function DisplayOpenVPNConfig()
|
||||
{
|
||||
|
||||
exec('cat '. RASPI_OPENVPN_CLIENT_CONFIG, $returnClient);
|
||||
exec('cat '. RASPI_OPENVPN_SERVER_CONFIG, $returnServer);
|
||||
exec('pidof openvpn | wc -l', $openvpnstatus);
|
||||
|
||||
// parse client settings
|
||||
foreach ($returnClient as $a) {
|
||||
if ($a[0] != "#") {
|
||||
$arrLine = explode(" ", $a) ;
|
||||
$arrClientConfig[$arrLine[0]]=$arrLine[1];
|
||||
}
|
||||
}
|
||||
|
||||
// parse server settings
|
||||
foreach ($returnServer as $a) {
|
||||
if ($a[0] != "#") {
|
||||
$arrLine = explode(" ", $a) ;
|
||||
$arrServerConfig[$arrLine[0]]=$arrLine[1];
|
||||
}
|
||||
}
|
||||
echo renderTemplate("openvpn", compact(
|
||||
"status",
|
||||
"openvpnStatus"
|
||||
));
|
||||
}
|
||||
|
Reference in New Issue
Block a user