1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2013-2014 OpenWrt.org
13 local maxtime
="$(maxtime)"
14 local curtime
="$(date +%s)"
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"
30 for file in $
( find /etc
-type f
) ; do
31 [ -z "$newest" -o "$newest" -ot "$file" ] && newest
=$file
33 [ "$newest" ] && date -r "$newest" +%s