From b081d2e3bf990bc1eee6bcaceeccab01d836e052 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 6 Jun 2016 10:30:52 -0400 Subject: [PATCH] rename fs_monitor to monitor_id, which is what it is --- scripts/zmaudit.pl.in | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/scripts/zmaudit.pl.in b/scripts/zmaudit.pl.in index cd34da590..6dbf739e5 100644 --- a/scripts/zmaudit.pl.in +++ b/scripts/zmaudit.pl.in @@ -255,29 +255,29 @@ MAIN: while( $loop ) { redo MAIN if ( $cleaned ); $cleaned = 0; - while ( my ( $fs_monitor, $fs_events ) = each(%$fs_monitors) ) { - if ( my $db_events = $db_monitors->{$fs_monitor} ) { + while ( my ( $monitor_id, $fs_events ) = each(%$fs_monitors) ) { + if ( my $db_events = $db_monitors->{$monitor_id} ) { next if ! $fs_events; - foreach my $fs_event ( sort { $a <=> $b } keys %$fs_events ) { - my $age = $fs_events->{$fs_event}; - if ( !defined($db_events->{$fs_event}) && ($age < 0 || ($age > $Config{ZM_AUDIT_MIN_AGE})) ) { - aud_print( "Filesystem event '$fs_monitor/$fs_event' does not exist in database" ); - if ( confirm() ) { - my $Event = new ZoneMinder::Event( $fs_event ); -# Must set these because the db event does not exist - $Event->MonitorId( $fs_monitor ); - $Event->StorageId( $Storage->Id() ); - $Event->delete_files(); - $cleaned = 1; - delete $fs_events->{$fs_event}; - } # end if confirm - } # end if ! in db events and old enough - } # end foreach fs event + foreach my $fs_event ( sort { $a <=> $b } keys %$fs_events ) { + my $age = $fs_events->{$fs_event}; + if ( !defined($db_events->{$fs_event}) && ($age < 0 || ($age > $Config{ZM_AUDIT_MIN_AGE})) ) { + aud_print( "Filesystem event '$$Storage{Path}/$monitor_id/$fs_event' does not exist in database" ); + if ( confirm() ) { + my $Event = new ZoneMinder::Event( $fs_event ); +# Must set these because the db event does not exist, however these are not enough. + $Event->MonitorId( $monitor_id ); + $Event->StorageId( $Storage->Id() ); + $Event->delete_files(); + $cleaned = 1; + delete $fs_events->{$fs_event}; + } # end if confirm + } # end if ! in db events and old enough + } # end foreach fs event } else { - aud_print( "Filesystem monitor '$fs_monitor' in $$Storage{Path} does not exist in database" ); + aud_print( "Filesystem monitor '$monitor_id' in $$Storage{Path} does not exist in database" ); if ( confirm() ) { - my $command = "rm -rf $fs_monitor"; + my $command = "rm -rf $monitor_id"; executeShellCommand( $command ); $cleaned = 1; }