Fix a bug when comparing dates in IS_KERNELUPTODATE check.

This commit is contained in:
Romain Dessort 2012-02-27 11:54:55 +01:00
parent 7297c07faf
commit c00c5a9677

View file

@ -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) > $(date -d $(LANG=en_US.UTF8 LANGUAGE=C who -b | tr -s " " | cut -d " " -f 4) +%s) )); 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
echo 'IS_KERNELUPTODATE FAILED!'
fi
fi
@ -454,4 +454,4 @@ if [ "$IS_EVOMAINTENANCECONF" = 1 ]; then
&& grep "^URGENCYFROM" $f |grep -qv "mama.doe@example.com" \
&& grep "^URGENCYTEL" $f |grep -qv "06.00.00.00.00" \
&& grep "^REALM" $f |grep -qv "example.com" ) || echo 'IS_EVOMAINTENANCECONF FAILED!'
fi
fi