1
0
mirror of https://github.com/billz/raspap-webgui.git synced 2023-10-10 13:37:24 +02:00
raspap-webgui/ajax/logging/clearlog.php

14 lines
331 B
PHP
Raw Normal View History

2022-09-26 21:53:06 +02:00
<?php
2023-02-16 23:25:43 +01:00
require '../../includes/csrf.php';
2022-09-26 21:53:06 +02:00
require_once '../../includes/config.php';
require_once '../../includes/functions.php';
2022-09-27 11:46:59 +02:00
if (isset($_POST['logfile'])) {
2023-02-17 19:05:36 +01:00
$logfile = escapeshellcmd($_POST['logfile']);
2022-09-26 21:53:06 +02:00
2022-09-27 11:46:59 +02:00
// truncate requested log file
exec("sudo truncate -s 0 $logfile", $return);
2022-09-26 21:53:06 +02:00
echo json_encode($return);
}