e03d60e1a5e6ad8820397bd0dc4dcb440d234804
[project/luci.git] / modules / admin-core / root / etc / init.d / luci_fixtime
1 #!/bin/sh /etc/rc.common
2
3 START=05
4 STOP=95
5
6 start() {
7         cat <<' EOF' | lua -l luci.fs -l luci.util -
8                 if (os.time() < 1000000000) then
9                         os.execute('date -s ' .. os.date('%Y%m%d%H%M', luci.fs.mtime("/etc/init.d/luci_fixtime")))
10                 end
11         EOF
12 }
13
14 stop() {
15         [[ -w /etc/init.d/luci_fixtime ]] && touch /etc/init.d/luci_fixtime
16 }