#!/sbin/openrc-run
#
# Restore / save the current clock on machines without a working RTC.
#

description="Restore / save the current clock"

depend() {
	before checkroot checkfs
	provide fake-hwclock
}

start() {
	ebegin "Loading system time from fake-hwclock"
	fake-hwclock load
	eend $?
}

stop() {
	ebegin "Saving system time to fake-hwclock"
	fake-hwclock save
	eend $?
}

reload() {
	stop
	start
}
