2009-10-13 12:33:45 +05:30
|
|
|
#!@PREFIX@/sbin/runscript
|
|
|
|
# Copyright (c) 2009 Roy Marples <roy@marples.name>
|
2011-06-30 05:16:31 +05:30
|
|
|
# Released under the 2-clause BSD license.
|
2009-10-13 12:33:45 +05:30
|
|
|
|
|
|
|
description="Sets the local clock to the mtime of a given file."
|
|
|
|
|
|
|
|
depend()
|
|
|
|
{
|
|
|
|
before *
|
2009-10-14 01:36:35 +05:30
|
|
|
provide clock
|
2012-01-25 23:12:32 +05:30
|
|
|
keyword -openvz -uml -vserver -xenu -lxc
|
2009-10-13 12:33:45 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
# swclock is an OpenRC built in
|
|
|
|
|
|
|
|
start()
|
|
|
|
{
|
|
|
|
ebegin "Setting the local clock based on last shutdown time"
|
2011-07-28 19:42:35 +05:30
|
|
|
if ! swclock 2> /dev/null; then
|
|
|
|
swclock --warn @PREFIX@/sbin/runscript
|
|
|
|
fi
|
2009-10-13 12:33:45 +05:30
|
|
|
eend $?
|
|
|
|
}
|
|
|
|
|
|
|
|
stop()
|
|
|
|
{
|
|
|
|
ebegin "Saving the shutdown time"
|
|
|
|
swclock --save
|
|
|
|
eend $?
|
|
|
|
}
|