X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=dsa-nagios-checks%2Fsbin%2Fdsa-update-apt-status;h=7919f71a1523e2e52cd2259948ff148197e09052;hb=a054fb3a6807f58d951cbab9787853308837b7ec;hp=8eebe1acf513914672d5cf17b996947e7c47da65;hpb=e5b63a271a6def4e2b3a3e23857edde90880d2e0;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..7919f71 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,10 @@ run_required() { return $norun } +if [ ! -d "${STATUSDIR}" ]; then + mkdir -p "${STATUSDIR}" +fi + # do stuff only when required, or when asked to if [ "${1:-""}" != "-f" ] ; then run_required || exit 0