2011-05-26 04:45:00 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
. /etc/rc.conf
|
|
|
|
. /etc/rc.d/functions
|
|
|
|
|
|
|
|
case $HARDWARECLOCK in
|
|
|
|
UTC) HWCLOCK_PARAMS="--utc";;
|
|
|
|
localtime) HWCLOCK_PARAMS="--localtime";;
|
|
|
|
*) HWCLOCK_PARAMS="";;
|
|
|
|
esac
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
start)
|
2011-08-08 04:11:13 +00:00
|
|
|
add_daemon hwclock;;
|
2011-05-26 04:45:00 +00:00
|
|
|
stop)
|
2011-08-08 04:11:13 +00:00
|
|
|
case $HARDWARECLOCK in
|
|
|
|
UTC) hwclock --adjust --utc;;
|
|
|
|
localtime) hwclock --adjust --localtime;;
|
|
|
|
"") hwclock --adjust;;
|
|
|
|
esac
|
2011-05-26 04:45:00 +00:00
|
|
|
rm_daemon hwclock
|
|
|
|
;;
|
|
|
|
restart)
|
|
|
|
$0 stop
|
2011-08-08 04:11:13 +00:00
|
|
|
sleep 2
|
2011-05-26 04:45:00 +00:00
|
|
|
$0 start
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "usage: $0 {start|stop|restart}"
|
|
|
|
esac
|