From 034b88faa446a5d3fa50155c6b75d460af6ff5cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=2ES?= Date: Wed, 31 Jan 2018 16:25:28 +0100 Subject: [PATCH] IS_UPTIME in --cron mode && IS_NOTUPGRADED at 90d --- evocheck.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/evocheck.sh b/evocheck.sh index f0764b9..c8e3da1 100755 --- a/evocheck.sh +++ b/evocheck.sh @@ -122,6 +122,7 @@ test -f /etc/evocheck.cf && . /etc/evocheck.cf # If --cron is passed, ignore some checks. if [ "$1" = "--cron" ]; then IS_KERNELUPTODATE=0 + IS_UPTIME=0 fi # Functions @@ -476,7 +477,7 @@ if [ -e /etc/debian_version ]; then # Check if the server is running for more than a year. if [ "$IS_UPTIME" = 1 ]; then - if is_installed linux-image* && [ $(date -d "now - 1 year" +%s) -gt $(($(date +%s) - $(cut -f1 -d '.' /proc/uptime))) ]; then + if is_installed linux-image* && [ $(date -d "now - 2 year" +%s) -gt $(($(date +%s) - $(cut -f1 -d '.' /proc/uptime))) ]; then echo 'IS_UPTIME FAILED!' fi fi @@ -506,7 +507,7 @@ 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 - 60 days") + limit=$(date +%s -d "now - 90 days") if [ -f /var/log/evolinux/00_prepare_system.log ]; then install_date=$(stat -c %Z /var/log/evolinux/00_prepare_system.log) else