Fix code readability and scoping

This commit is contained in:
Ilia Ross
2025-01-20 16:19:38 +02:00
parent 67391244e4
commit aae7bb5ac8

View File

@ -20,18 +20,22 @@ if (!$config{'firewall_system'}) {
}
# See if this process is already running
if ($pid = &check_pid_file($pid_file)) {
if (my $pid = &check_pid_file($pid_file)) {
print STDERR "rotate.pl process $pid is already running\n";
exit;
}
open(PID, ">$pid_file");
print PID $$,"\n";
close(PID);
open(my $pid, ">$pid_file");
print $pid $$,"\n";
close($pid);
# Get the current time
$time_now = time();
@time_now = localtime($time_now);
@hours = ( );
# Pre-process command
&pre_process();
# Scan the entries in the log file
&pre_process();
open(LOG, "<".$bandwidth_log);