From: Peter Palfrader Date: Mon, 26 Nov 2018 13:25:08 +0000 (+0100) Subject: Cleanup dsa-update-unowned-file-status and dsa-update-unowned-file-status creation... X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fdsa-nagios.git;a=commitdiff_plain;h=0186eaeb34890c5eacc7baead5466be9bfae03e1 Cleanup dsa-update-unowned-file-status and dsa-update-unowned-file-status creation of statusdir --- diff --git a/dsa-nagios-checks/sbin/dsa-update-apt-status b/dsa-nagios-checks/sbin/dsa-update-apt-status index 7919f71..c506fea 100755 --- a/dsa-nagios-checks/sbin/dsa-update-apt-status +++ b/dsa-nagios-checks/sbin/dsa-update-apt-status @@ -51,9 +51,7 @@ run_required() { return $norun } -if [ ! -d "${STATUSDIR}" ]; then - mkdir -p "${STATUSDIR}" -fi +mkdir -p "${STATUSDIR}" # do stuff only when required, or when asked to if [ "${1:-""}" != "-f" ] ; then diff --git a/dsa-nagios-checks/sbin/dsa-update-unowned-file-status b/dsa-nagios-checks/sbin/dsa-update-unowned-file-status index cc4e812..56331ef 100755 --- a/dsa-nagios-checks/sbin/dsa-update-unowned-file-status +++ b/dsa-nagios-checks/sbin/dsa-update-unowned-file-status @@ -25,9 +25,7 @@ CUTOFF=40 STATUSDIR=/var/cache/dsa/nagios STATUS="${STATUSDIR}"/nouser -if [ ! -d "${STATUSDIR}" ]; then - mkdir -p "${STATUSDIR}" -fi +mkdir -p "${STATUSDIR}" tmp=`tempfile` trap "rm -f '$tmp'" exit