modules/admin: Make sure luci_fixtime works on mini_fo (#262)
[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 ]] && cat /dev/null >> /etc/init.d/luci_fixtime && touch /etc/init.d/luci_fixtime
16 }