From 428b91b731b7c402421afbe075899b6007b70d12 Mon Sep 17 00:00:00 2001 From: Romain Dessort Date: Mon, 27 Feb 2012 12:06:33 +0100 Subject: [PATCH] Improve IS_KERNELUPTODATE to check if the kernel is installed. --- evocheck.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evocheck.sh b/evocheck.sh index af4d1ab..d7da555 100755 --- a/evocheck.sh +++ b/evocheck.sh @@ -313,7 +313,7 @@ if [ -e /etc/debian_version ]; then # Verification si le système doit redémarrer suite màj kernel. if [ "$IS_KERNELUPTODATE" = 1 ]; then - if [ $(date -d $(ls --full-time -lcrt /boot | tail -n1 | tr -s " " | cut -d " " -f 6) +%s) -gt $(date -d $(LANG=en_US.UTF8 LANGUAGE=C who -b | tr -s " " | cut -d " " -f 4) +%s) ]; then + if is_installed linux-image* && [ $(date -d $(ls --full-time -lcrt /boot | tail -n1 | tr -s " " | cut -d " " -f 6) +%s) -gt $(date -d $(LANG=en_US.UTF8 LANGUAGE=C who -b | tr -s " " | cut -d " " -f 4) +%s) ]; then echo 'IS_KERNELUPTODATE FAILED!' fi fi