modules/admin-core: correct date format in luci_fixtime, save time on shutdown (OpenWrt #6921)
This commit is contained in:
parent
96381bf0d8
commit
73aadcd119
1 changed files with 6 additions and 1 deletions
|
@ -1,11 +1,16 @@
|
||||||
#!/bin/sh /etc/rc.common
|
#!/bin/sh /etc/rc.common
|
||||||
|
|
||||||
START=05
|
START=05
|
||||||
|
STOP=95
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
cat <<' EOF' | lua -l luci.fs -l luci.util -
|
cat <<' EOF' | lua -l luci.fs -l luci.util -
|
||||||
if (os.time() < 1000000000) then
|
if (os.time() < 1000000000) then
|
||||||
os.execute('date -s ' .. os.date('%m%d%H%M%Y', luci.fs.mtime("/etc/init.d/luci_fixtime")))
|
os.execute('date -s ' .. os.date('%Y%m%d%H%M', luci.fs.mtime("/etc/init.d/luci_fixtime")))
|
||||||
end
|
end
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stop() {
|
||||||
|
[[ -w /etc/init.d/luci_fixtime ]] && touch /etc/init.d/luci_fixtime
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue