summaryrefslogtreecommitdiff
path: root/package/base-files/files/etc/init.d/sysfixtime
blob: 4010e06f936f99ee03f4dfc569451a36b55545c7 (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 -r {} +%s \; | sort -nr | head -n1)"
	[ $curtime -lt $maxtime ] && date -s @$maxtime
}