From 92b18e201c7a190b145c260d09af126701af6b17 Mon Sep 17 00:00:00 2001 From: Romain Dessort Date: Fri, 23 Mar 2018 15:36:45 -0400 Subject: [PATCH] Fix evoqa #3623: custom limit for IS_NOTUPGRADED Set higher time limit for servers not being part of the regular upgrade process: - if mails are sent to listupgrade-todo@ - or if listupgrade.sh is not executed on a weekly basis. --- evocheck.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/evocheck.sh b/evocheck.sh index bd45a25..e171585 100755 --- a/evocheck.sh +++ b/evocheck.sh @@ -519,7 +519,14 @@ if [ -e /etc/debian_version ]; then # Check if no package has been upgraded since $limit. if [ "$IS_NOTUPGRADED" = 1 ]; then last_upgrade=$(date +%s -d $(zgrep -h upgrade /var/log/dpkg.log* |sort -n |tail -1 |cut -f1 -d ' ')) - limit=$(date +%s -d "now - 90 days") + if grep -q '^mailto="listupgrade-todo@' /etc/evolinux/listupgrade.cnf \ + || grep -q -E '^[[:digit:]]+[[:space:]]+[[:digit:]]+[[:space:]]+[^\*]' /etc/cron.d/listupgrade; then + # Manual upgrade process + limit=$(date +%s -d "now - 180 days") + else + # Regular process + limit=$(date +%s -d "now - 90 days") + fi if [ -f /var/log/evolinux/00_prepare_system.log ]; then install_date=$(stat -c %Z /var/log/evolinux/00_prepare_system.log) else