Fix monitor not change status when zoneminder state change
parent
e84b82df18
commit
3d093ed8a6
|
@ -118,12 +118,7 @@ if ( $command eq 'state' ) {
|
||||||
($Config{ZM_SERVER_ID} ? (ServerId=>$Config{ZM_SERVER_ID}) : () ), order=>'Id ASC')
|
($Config{ZM_SERVER_ID} ? (ServerId=>$Config{ZM_SERVER_ID}) : () ), order=>'Id ASC')
|
||||||
) {
|
) {
|
||||||
foreach my $definition ( @{$state->{Definitions}} ) {
|
foreach my $definition ( @{$state->{Definitions}} ) {
|
||||||
# FIXME WHY a REGEXP
|
|
||||||
if ( $monitor->{Id} =~ /^$definition->{Id}$/ ) {
|
if ( $monitor->{Id} =~ /^$definition->{Id}$/ ) {
|
||||||
$monitor->{NewFunction} = $definition->{Function};
|
|
||||||
$monitor->{NewEnabled} = $definition->{Enabled};
|
|
||||||
last;
|
|
||||||
}
|
|
||||||
if (
|
if (
|
||||||
($monitor->{Capturing} ne $definition->{Capturing})
|
($monitor->{Capturing} ne $definition->{Capturing})
|
||||||
or
|
or
|
||||||
|
@ -134,6 +129,7 @@ if ( $command eq 'state' ) {
|
||||||
$monitor->save({ map { $_ => $$definition{$_} } qw(Capturing Analysing Recording) });
|
$monitor->save({ map { $_ => $$definition{$_} } qw(Capturing Analysing Recording) });
|
||||||
last; # definition
|
last; # definition
|
||||||
} # end if
|
} # end if
|
||||||
|
} # end if
|
||||||
} # end foreach definition
|
} # end foreach definition
|
||||||
} # end foreach monitor
|
} # end foreach monitor
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue