X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=dsa-nagios-checks%2Fsbin%2Fdsa-update-apt-status;h=8a278ce7e757d9f400c82c917060d21cde7434ec;hb=9b1daa60006e903699f8f37d1ecb6e37dfcfa043;hp=3e3acefbb627d3839494b1ffe7c54d1a061185d7;hpb=42e99da9d896a33803e763c746e9a103183b6b34;p=mirror%2Fdsa-nagios.git diff --git a/dsa-nagios-checks/sbin/dsa-update-apt-status b/dsa-nagios-checks/sbin/dsa-update-apt-status index 3e3acef..8a278ce 100755 --- a/dsa-nagios-checks/sbin/dsa-update-apt-status +++ b/dsa-nagios-checks/sbin/dsa-update-apt-status @@ -1,4 +1,25 @@ -#!/bin/sh +#!/bin/bash + +# Copyright 2009 Peter Palfrader +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. UPDATE_RUNS=3 STATUS=/var/cache/dsa/nagios/apt @@ -29,8 +50,10 @@ run_required() { return $norun } -# do stuff only when required -run_required || exit +# do stuff only when required, or when asked to +if [ "${1:-""}" != "-f" ] ; then + run_required || exit 0 +fi # sleep if called non-interactively if [ -z "$TERM" -o "$TERM" = "dumb" ]; then