summaryrefslogtreecommitdiff
path: root/adjtime
blob: 8a894f1380ccc0dd8ca77e0b8a7ef642bf9f5754 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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