X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=dsa-nagios-checks%2Fsbin%2Fdsa-update-apt-status;h=c506feaf2f87841573fcbec95a04b2111ee40abc;hb=4f724a4db023ca6e29f0df0db8867b1aabee78c2;hp=8eebe1acf513914672d5cf17b996947e7c47da65;hpb=b70c49312b88d414500d2e3ff85dda7d1e10c1a9;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 8eebe1a..c506fea 100755 --- a/dsa-nagios-checks/sbin/dsa-update-apt-status +++ b/dsa-nagios-checks/sbin/dsa-update-apt-status @@ -22,7 +22,8 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. UPDATE_RUNS=3 -STATUS=/var/cache/dsa/nagios/apt +STATUSDIR=/var/cache/dsa/nagios +STATUS="${STATUSDIR}"/apt SLEEP_MAX=$(( 15 * 60 )) MAX_AGE=$(( 23 * 60 * 60 )) @@ -50,6 +51,8 @@ run_required() { return $norun } +mkdir -p "${STATUSDIR}" + # do stuff only when required, or when asked to if [ "${1:-""}" != "-f" ] ; then run_required || exit 0