summaryrefslogtreecommitdiff
path: root/adjtime
diff options
context:
space:
mode:
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