From b3db96780cd27c0e9ab35f71c841e692a524f8cb Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Wed, 31 Dec 2014 10:50:29 +0100 Subject: [PATCH] Do not remove failed cache file on Nagios mode --- check_rc_upgrade.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_rc_upgrade.sh b/check_rc_upgrade.sh index 2d437ff..6f0ad4a 100755 --- a/check_rc_upgrade.sh +++ b/check_rc_upgrade.sh @@ -83,7 +83,7 @@ do if [ -n "$newest" ] then [ $DEBUG -eq 1 ] && echo "Newest : $newest" - rm -f $CACHE_FAILED > /dev/null 2>&1 + [ $NAGIOS -ne 1 ] && rm -f $CACHE_FAILED > /dev/null 2>&1 DOWNLOAD_URL=`cat $tmpfile|grep "$newest"|grep "tar.gz"|head -1|sed 's/.* href="[ \t]*\([^"]*\)[ \t]*" .*$/\1/'` [ $DEBUG -eq 1 ] && echo "Download URL : $DOWNLOAD_URL"