From e49f10c8c838e9d2cc817515b155c5ca4e127eb7 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sun, 6 Jul 2008 11:29:31 +0200 Subject: [PATCH] [project @ peter@palfrader.org-20080706092931-m2wp14enpqeq7q2q] Comment dsa-update-apt-status --- dsa-nagios-nrpe-config/dsa-update-apt-status | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dsa-nagios-nrpe-config/dsa-update-apt-status b/dsa-nagios-nrpe-config/dsa-update-apt-status index 685f966..47c7e7a 100755 --- a/dsa-nagios-nrpe-config/dsa-update-apt-status +++ b/dsa-nagios-nrpe-config/dsa-update-apt-status @@ -3,9 +3,12 @@ UPDATE_RUNS=3 STATUS=/var/cache/dsa/nagios/apt +# sleep if called non-interactively if [ -z "$TERM" -o "$TERM" = "dumb" ]; then sleep $(( $RANDOM % 7200 )) fi + +# run apt-get update, retry a few times if it fails count=0 while [ "$count" -lt "$UPDATE_RUNS" ]; do apt-get update -qq @@ -19,6 +22,7 @@ if [ "$count" -ge "$UPDATE_RUNS" ]; then exit 1 fi +# run the apt check itself tmp=`tempfile` trap "rm -f '$tmp'" exit /usr/share/dsa/apt-status-check --noupdate --timeout=600 > "$tmp" -- 2.20.1