From 30dfadcbf1aa6cf478614809675b3be8d85d81e9 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 7 Apr 2021 14:15:51 -0400 Subject: [PATCH] Add some parenthesis and use logic and/or install of binary --- scripts/zmtrigger.pl.in | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/zmtrigger.pl.in b/scripts/zmtrigger.pl.in index c409bde33..041d1c449 100644 --- a/scripts/zmtrigger.pl.in +++ b/scripts/zmtrigger.pl.in @@ -226,10 +226,10 @@ while (!$zm_terminate) { #print( "$monitor->{Id}: S:$state, LE:$last_event" ); #print( "$monitor->{Id}: mS:$monitor->{LastState}, mLE:$monitor->{LastEvent}" ); - if ( $state == STATE_ALARM || $state == STATE_ALERT ) { + if ( $state == STATE_ALARM or $state == STATE_ALERT ) { # In alarm state if ( !defined($monitor->{LastEvent}) - || ($last_event != $monitor->{LastEvent}) + or ($last_event != $monitor->{LastEvent}) ) { # A new event push @out_messages, $monitor->{Id}.'|on|'.time().'|'.$last_event; @@ -238,9 +238,9 @@ while (!$zm_terminate) { # Do nothing } } elsif ( - ($state == STATE_IDLE && $monitor->{LastState} != STATE_IDLE) - || - ($state == STATE_TAPE && $monitor->{LastState} != STATE_TAPE) + (($state == STATE_IDLE) and ($monitor->{LastState} != STATE_IDLE)) + or + (($state == STATE_TAPE) and ($monitor->{LastState} != STATE_TAPE)) ) { # Out of alarm state push @out_messages, $monitor->{Id}.'|off|'.time().'|'.$last_event;