mirror of
				https://github.com/billz/raspap-webgui.git
				synced 2025-03-01 10:31:47 +00:00 
			
		
		
		
	Persist log-openvpn option
This commit is contained in:
		| @@ -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'); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user