1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2013-2014 OpenWrt.org
13 local curtime="$(date +%s)"
14 local maxtime="$(find /etc -type f -exec date -r {} +%s \; | sort -nr | head -n1)"
15 [ $curtime -lt $maxtime ] && date -s @$maxtime
19 [ -e "$RTC_DEV" ] && [ -e "$HWCLOCK" ] && $HWCLOCK -s -f $RTC_DEV
23 [ -e "$RTC_DEV" ] && [ -e "$HWCLOCK" ] && $HWCLOCK -w -f $RTC_DEV && \
24 logger -t sysfixtime "saved '$(date)' to $RTC_DEV"