blob: 05e974a7abe0f03eff900681ac238769f23fc446 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
#!/bin/sh
# Begin /etc/init.d/setclock
### BEGIN INIT INFO
# Provides: $time
# Required-Start: udev swap
# Should-Start:
# Required-Stop: $network $syslog $local_fs
# Should-Stop: halt reboot
# Default-Start: sysinit
# Default-Stop:
# Short-Description: Stores and restores time from the hardware clock
# Description: On boot, system time is obtained from hwclock. The
# hardware clock can also be set on shutdown.
# X-LFS-Default-Start: S25
# X-LFS-Default-Stop: K46
# X-LFS-Provided-By: LFS BLFS
### END INIT INFO
. /lib/lsb/init-functions
BIN_FILE="/sbin/hwclock"
CONFIGFILE="/etc/sysconfig/clock"
chk_stat
. "${CONFIGFILE}"
CLOCKPARAMS=
case "${UTC}" in
yes|true|1)
CLOCKPARAMS="${CLOCKPARAMS} --utc"
;;
no|false|0)
CLOCKPARAMS="${CLOCKPARAMS} --localtime"
;;
esac
case ${1} in
start)
message="Setting system clock..."
${BIN_FILE} --hctosys ${CLOCKPARAMS} >/dev/null
evaluate_retval standard
;;
stop)
message="Setting hardware clock..."
${BIN_FILE} --systohc ${CLOCKPARAMS} >/dev/null
evaluate_retval standard
;;
*)
echo "Usage: ${0} {start|stop}"
;;
esac
# End /etc/init.d/setclock
|