From f4b2706e0f4221193c3197ed1923283673d89c75 Mon Sep 17 00:00:00 2001 From: Jon1760 <92548217+Jon1760@users.noreply.github.com> Date: Thu, 11 Nov 2021 12:01:20 -0500 Subject: [PATCH] Corrected test for updating cache Removed spurious ")" from first clause so it's true only when current "fingerprint" and cached "fingerprint" actually differ. OR instead of AND so that updates don't happen only in the first 120 seconds after the machine is rebooted. --- agents/plugins/yum | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/agents/plugins/yum b/agents/plugins/yum index 45f8b62..572e23e 100755 --- a/agents/plugins/yum +++ b/agents/plugins/yum @@ -56,7 +56,8 @@ fi echo "<<>>" # compare current and cached yum information -if [ "$YUM_CURRENT" != "$YUM_CACHED)" ] && [ ! -s $CACHE_RESULT_CHECK ] +# Update cached data if YUM fingerprint has changed OR machine has recently rebooted. +if [ "$YUM_CURRENT" != "$YUM_CACHED" ] || [ ! -s $CACHE_RESULT_CHECK ] then count=0 while [ -n "$(pgrep -f "python /usr/bin/yum")" ]; do @@ -122,4 +123,4 @@ then else # use cache file cat $CACHE_RESULT_CHECK -fi \ No newline at end of file +fi