From a32b77510d081201d5ffff72583d008084ea47cd Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 28 Feb 2022 09:38:54 -0500 Subject: [PATCH] Fix logic on error reporting of failure to connect to db --- scripts/zmtelemetry.pl.in | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/zmtelemetry.pl.in b/scripts/zmtelemetry.pl.in index 0daae4c79..61332bf2d 100644 --- a/scripts/zmtelemetry.pl.in +++ b/scripts/zmtelemetry.pl.in @@ -115,11 +115,11 @@ while (1) { $Config{ZM_TELEMETRY_LAST_UPLOAD} = $now; } zmDbDisconnect(); - } elsif ( -t STDIN ) { - print "ZoneMinder Telemetry Agent sleeping for $interval seconds because ($now-$lastCheck=$since_last_check > $interval\n"; - } - } else { - Error("Failed to opem database. Sleeping."); + } else { + Error('Failed to open database. Sleeping.'); + } + } elsif (-t STDIN) { + print "ZoneMinder Telemetry Agent sleeping for $interval seconds because ($now-$lastCheck=$since_last_check > $interval\n"; } $lastCheck = $now; sleep($interval);