Fix #1200. Replace who -b by uptime -s which does not depend on a TTY and locales.

This commit is contained in:
Romain Dessort 2016-05-10 17:16:19 -04:00
parent 596fad44d1
commit e59adc86f9

View file

@ -385,7 +385,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 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
if is_installed linux-image* && [ $(date -d $(ls --full-time -lcrt /boot | tail -n1 | tr -s " " | cut -d " " -f 6) +%s) -gt $(date -d "$(uptime -s)" +%s) ]; then
echo 'IS_KERNELUPTODATE FAILED!'
fi
fi