]>
git.ipfire.org Git - ipfire-2.x.git/blob - src/initscripts/system/setclock
2 ########################################################################
3 # Begin $rc_base/init.d/setclock
5 # Description : Setting Linux Clock
7 # Authors : Gerard Beekmans - gerard@linuxfromscratch.org
13 ########################################################################
23 boot_mesg
"Setting system clock..."
25 # udev not create the rtc symlink if rtc is in the kernel
26 if [ ! -e /dev
/rtc
]; then
27 if [ -e /dev
/rtc0
]; then
32 hwclock --hctosys ${CLOCKPARAMS} &>/dev
/null
35 if [ -e /var
/log
/messages
]; then
36 LOGTIMESTAMP
=`stat --format "%y" /var/log/messages`
37 LOGTIME
=`date +%s -d "$LOGTIMESTAMP"`
39 if [ $SYSTIME -lt $LOGTIME ]; then
40 boot_mesg
"Warning! clock runs later than last log access. Check battery/rtc!"
41 date -s "$LOGTIMESTAMP"
50 boot_mesg
"Setting hardware clock..."
51 hwclock --systohc ${CLOCKPARAMS} &>/dev
/null
56 echo "Usage: ${0} {start} {stop}"