+

Do not remove failed cache file on Nagios mode

Benjamin Renard [2014-12-31 09:50:29]
Do not remove failed cache file on Nagios mode
Filename
check_rc_upgrade.sh
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"
ViewGit