aboutsummaryrefslogtreecommitdiff
path: root/init.d/swclock.in
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2022-12-08 09:56:40 -0600
committerWilliam Hubbs <w.d.hubbs@gmail.com>2022-12-08 09:56:40 -0600
commit839083bb523b82cca28d3f0ecc8d4c3469a0853d (patch)
tree3d41ab1c40404808f5814df3e2eb7ccb2e3a453f /init.d/swclock.in
parent1364e6631c7f266484981d88be43f9b039f76b6a (diff)
make the location of the swclock reference file configurable
This fixes #565.
Diffstat (limited to 'init.d/swclock.in')
-rw-r--r--init.d/swclock.in5
1 files changed, 3 insertions, 2 deletions
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 $?
}