* Merged newxml into HEAD
[linux_from_scratch.git] / bootscripts / lfs / init.d / setclock
bloba1e0ea85b37ef9041472046344a8304f22e1a288
1 #!/bin/sh
2 # Begin $rc_base/init.d/setclock - Setting Linux Clock
4 # Based on setclock script from LFS-3.1 and earlier.
5 # Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
7 . /etc/sysconfig/rc
8 . $rc_functions
9 . /etc/sysconfig/clock
11 CLOCKPARAMS=
13 case "$UTC" in
14 yes|true|1)
15 CLOCKPARAMS="$CLOCKPARAMS --utc"
18 no|false|0)
19 CLOCKPARAMS="$CLOCKPARAMS --localtime"
22 esac
24 case $1 in
25 start)
26 echo "Setting system clock..."
27 hwclock --hctosys $CLOCKPARAMS
28 evaluate_retval
31 stop)
32 echo "Setting hardware clock..."
33 hwclock --systohc $CLOCKPARAMS
34 evaluate_retval
38 echo "Usage: $0 {start}"
41 esac