mirror of
https://github.com/SubleXBle/Fail2Ban-Report.git
synced 2026-05-08 16:09:12 -05:00
Create list-files.php
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
// Directory with JSON files
|
||||
$jsonDir = __DIR__ . '/archive/';
|
||||
|
||||
// List all matching JSON files
|
||||
$files = array_values(array_filter(scandir($jsonDir), function($f) {
|
||||
return preg_match('/^fail2ban-events-\d{8}\.json$/', $f);
|
||||
}));
|
||||
|
||||
// Sort files descending (newest first)
|
||||
rsort($files);
|
||||
|
||||
// Output as JSON for JS
|
||||
$filesJson = json_encode($files);
|
||||
?>
|
||||
Reference in New Issue
Block a user