summaryrefslogtreecommitdiff
path: root/package/base-files/files/etc/init.d/sysfixtime
blob: ca19e78e025bd389935fbbf8f5f1c58a5085d79c (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/sh /etc/rc.common
# Copyright (C) 2013-2014 OpenWrt.org

START=00

boot() {
	local curtime="$(date +%s)"
	local maxtime="$(find /etc -type f -exec date +%s -r {} \; | sort -nr | head -n1)"
	[ $curtime -lt $maxtime ] && date -s @$maxtime
}