From fe1ef036bb283f77294781cc4d2c7be5207c012d Mon Sep 17 00:00:00 2001 From: Heuzef Date: Fri, 20 Sep 2019 10:50:53 +0200 Subject: [PATCH] Move lastAgeColor function --- Check.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Check.pm b/Check.pm index 6573a4c..7155657 100644 --- a/Check.pm +++ b/Check.pm @@ -73,6 +73,11 @@ sub action } else { $lastAge = sprintf("%.1f", (time - $lastAge) / (24 * 3600)); } + if ( $lastAge < 1.1 ) { + $lastAgeColor = "MediumSeaGreen"; + } else { + $lastAgeColor = "Tomato"; + } if ( $fullAge < 0 ) { $fullAge = ""; $fullRate = ""; @@ -119,11 +124,6 @@ sub action ($shortErr = $Status{$host}{error}) =~ s/(.{48}).*/$1.../; $shortErr = " ($shortErr)"; } - if ( $lastAge < 1.1 ) { - $lastAgeColor = "MediumSeaGreen"; - } else { - $lastAgeColor = "Tomato"; - } $str = <${HostLink($host)}