2013-02-13 03:39:50 +05:30
|
|
|
#!@SBINDIR@/runscript
|
2009-10-13 12:33:45 +05:30
|
|
|
# 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-07-03 08:34:22 +05:30
|
|
|
keyword -openvz -prefix -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
|
2013-02-13 03:39:50 +05:30
|
|
|
swclock --warn @SBINDIR@/runscript
|
2011-07-28 19:42:35 +05:30
|
|
|
fi
|
2009-10-13 12:33:45 +05:30
|
|
|
eend $?
|
|
|
|
}
|
|
|
|
|
|
|
|
stop()
|
|
|
|
{
|
|
|
|
ebegin "Saving the shutdown time"
|
|
|
|
swclock --save
|
|
|
|
eend $?
|
|
|
|
}
|