| Server IP : 173.209.174.21 / Your IP : 216.73.216.89 Web Server : Apache/2.4.58 (Ubuntu) System : Linux wcfs-server 6.8.0-124-generic #124-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 13:00:45 UTC 2026 x86_64 User : nodor ( 1000) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /usr/share/webmin/logrotate/ |
Upload File : |
#!/usr/bin/perl
# Delete a bunch of logrotate sections
require './logrotate-lib.pl';
&ReadParse();
# Validate inputs
&error_setup($text{'delete_err'});
@d = split(/\0/, $in{'d'});
@d || &error($text{'delete_enone'});
# Delete the sections
$parent = &get_config_parent();
$conf = $parent->{'members'};
foreach $d (sort { $b <=> $a } @d) {
$log = $conf->[$d];
&lock_file($log->{'file'});
&save_directive($parent, $log, undef);
push(@files, $log->{'file'});
}
&flush_file_lines();
# Write out config
foreach $f (&unique(@files)) {
&delete_if_empty($f);
&unlock_file($f);
}
&webmin_log("delete", "logs", scalar(@d));
&redirect("");