summaryrefslogtreecommitdiff
path: root/adjtime
diff options
context:
space:
mode:
authorDave Reisner <d@falconindy.com>2011-04-23 11:21:10 -0400
committerTom Gundersen <teg@jklm.no>2011-04-23 21:44:05 +0200
commita2b481098b19e49d8d9143bcaf385fccb9ba08e8 (patch)
tree44c1c5657261842548981531e5cf139ab82d752b /adjtime
parent5fcb5afeb15d0617407abfd5b0827153b632d7c4 (diff)
Use Makefile to replace install.sh
If we're going to use a Makefile for minilogd, we might as well use it for everything. This has some moving pieces: * fix minilogd rule: minilogd.o is a target dep not a build rule * rename adjtime.cron => adjtime * fixup PKGBUILD to account for changes Signed-off-by: Tom Gundersen <teg@jklm.no>
Diffstat (limited to 'adjtime')
-rwxr-xr-xadjtime15
1 files changed, 15 insertions, 0 deletions
diff --git a/adjtime b/adjtime
new file mode 100755
index 0000000..8a894f1
--- /dev/null
+++ b/adjtime
@@ -0,0 +1,15 @@
+#!/bin/bash
+# Update our hwclock for system drift
+
+. /etc/rc.conf
+
+HWCLOCK_PARAMS="--adjust"
+case $HARDWARECLOCK in
+ UTC) HWCLOCK_PARAMS+=" --utc";;
+ localtime) HWCLOCK_PARAMS+=" --localtime";;
+ *) HWCLOCK_PARAMS="";;
+esac
+
+if [[ $HWCLOCK_PARAMS && -f /run/daemons/hwclock ]]; then
+ /sbin/hwclock $HWCLOCK_PARAMS
+fi