From 839083bb523b82cca28d3f0ecc8d4c3469a0853d Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Thu, 8 Dec 2022 09:56:40 -0600 Subject: make the location of the swclock reference file configurable This fixes #565. --- init.d/swclock.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'init.d/swclock.in') diff --git a/init.d/swclock.in b/init.d/swclock.in index a85f4bae..63c052d1 100644 --- a/init.d/swclock.in +++ b/init.d/swclock.in @@ -10,6 +10,7 @@ # except according to the terms contained in the LICENSE file. description="Sets the local clock to the mtime of a given file." +swclock_file="${swclock_file:-/var/lib/misc/openrc-shutdowntime}" depend() { @@ -22,7 +23,7 @@ depend() start() { ebegin "Setting the local clock based on last shutdown time" - if ! swclock 2> /dev/null; then + if ! swclock "${swclock_file}" 2> /dev/null; then swclock --warn @SBINDIR@/openrc-run fi eend $? @@ -31,6 +32,6 @@ start() stop() { ebegin "Saving the shutdown time" - swclock --save + swclock --save "${swclock_file}" eend $? } -- cgit v1.2.3