Apply functionality to dnsmasq log

This commit is contained in:
billz
2022-09-27 11:46:59 +02:00
parent e57012679e
commit e422b4908e
4 changed files with 16 additions and 8 deletions

View File

@@ -3,10 +3,10 @@
require_once '../../includes/config.php';
require_once '../../includes/functions.php';
if (isset($_POST['svc'])) {
$tmplog = '/tmp/' .$_POST['svc']. '.log';
if (isset($_POST['logfile'])) {
$logfile = $_POST['logfile'];
// clear log for requested service
exec("sudo truncate -s 0 $tmplog", $return);
// truncate requested log file
exec("sudo truncate -s 0 $logfile", $return);
echo json_encode($return);
}