setclock: accept also empty logfile timestamp

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
This commit is contained in:
Arne Fitzenreiter
2016-10-09 12:10:15 +02:00
parent 0807ce69ee
commit f824cd285b

View File

@@ -32,7 +32,7 @@ case ${1} in
hwclock --hctosys ${CLOCKPARAMS} &>/dev/null
date
if [ -s /var/log/messages ]; then
if [ -e /var/log/messages ]; then
LOGTIMESTAMP=`stat --format "%y" /var/log/messages`
LOGTIME=`date +%s -d "$LOGTIMESTAMP"`
SYSTIME=`date +%s`