mirror of
https://github.com/RaspAP/raspap-webgui.git
synced 2024-11-25 00:50:29 +00:00
Persist log-openvpn option
This commit is contained in:
parent
04edc3a185
commit
0ffe0ecd4b
1 changed files with 9 additions and 1 deletions
|
@ -55,7 +55,15 @@ function DisplayOpenVPNConfig()
|
|||
}
|
||||
$clients = preg_grep('~\login.(conf)$~', scandir(pathinfo(RASPI_OPENVPN_CLIENT_LOGIN, PATHINFO_DIRNAME)));
|
||||
|
||||
if (isset($_POST['log-openvpn'])) {
|
||||
$logEnable = 0;
|
||||
if (!empty($_POST) && !isset($_POST['log-openvpn'])) {
|
||||
$logOutput = "";
|
||||
$f = @fopen("/tmp/openvpn.log", "r+");
|
||||
if ($f !== false) {
|
||||
ftruncate($f, 0);
|
||||
fclose($f);
|
||||
}
|
||||
} elseif (isset($_POST['log-openvpn']) || filesize('/tmp/openvpn.log') >0) {
|
||||
$logEnable = 1;
|
||||
exec("sudo /etc/raspap/openvpn/openvpnlog.sh", $logOutput);
|
||||
$logOutput = file_get_contents('/tmp/openvpn.log');
|
||||
|
|
Loading…
Reference in a new issue