diff options
Diffstat (limited to 'adjtime.cron')
-rwxr-xr-x | adjtime.cron | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/adjtime.cron b/adjtime.cron index 40c02f2..b1c8950 100755 --- a/adjtime.cron +++ b/adjtime.cron @@ -1,3 +1,17 @@ -#!/bin/sh +#!/bin/bash # Update our hwclock for system drift -/sbin/hwclock --adjust + +. /etc/rc.conf + +HWCLOCK_PARAMS="--adjust" +if [ "$HARDWARECLOCK" = "UTC" ]; then + HWCLOCK_PARAMS="$HWCLOCK_PARAMS --utc" +elif [ "$HARDWARECLOCK" = "localtime" ]; then + HWCLOCK_PARAMS="$HWCLOCK_PARAMS --localtime" +else + HWCLOCK_PARAMS="" +fi + +if [ -n "$HWCLOCK_PARAMS" ]; then + /sbin/hwclock $HWCLOCK_PARAMS +fi |