summaryrefslogtreecommitdiffhomepage
path: root/contrib/package
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2008-06-14 15:14:15 +0000
committerJo-Philipp Wich <jow@openwrt.org>2008-06-14 15:14:15 +0000
commit971ffe47da2fa5b154f0601f9ece2984ac7f5d50 (patch)
treed748442b1fa9315a91d535822a638a6a95610c39 /contrib/package
parentcb53f314f4cd3d60d64c36048f4dfd06f23cea3f (diff)
* luci/libs: move time fix to luci-addons
Diffstat (limited to 'contrib/package')
-rw-r--r--contrib/package/luci-addons/Makefile4
-rw-r--r--contrib/package/luci-addons/dist/etc/init.d/luci-fixtime10
2 files changed, 13 insertions, 1 deletions
diff --git a/contrib/package/luci-addons/Makefile b/contrib/package/luci-addons/Makefile
index 3428eb068..27d214d2f 100644
--- a/contrib/package/luci-addons/Makefile
+++ b/contrib/package/luci-addons/Makefile
@@ -26,12 +26,14 @@ define Package/luci-addons/install
$(INSTALL_DIR) $(1)/sbin
$(INSTALL_DIR) $(1)/etc/crontabs
$(INSTALL_DIR) $(1)/etc/hotplug.d/iface
+ $(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./dist/usr/bin/run-parts $(1)/usr/bin
$(INSTALL_BIN) ./dist/sbin/luci-flash $(1)/sbin
+ $(INSTALL_BIN) ./dist/etc/init.d/luci-fixtime $(1)/etc/init.d
$(CP) ./dist/etc/crontabs/root $(1)/etc/crontabs/root
$(CP) ./dist/etc/hotplug.d/iface/20-aliases $(1)/etc/hotplug.d/iface/20-aliases
endef
-$(eval $(call BuildPackage,luci-addons)) \ No newline at end of file
+$(eval $(call BuildPackage,luci-addons))
diff --git a/contrib/package/luci-addons/dist/etc/init.d/luci-fixtime b/contrib/package/luci-addons/dist/etc/init.d/luci-fixtime
new file mode 100644
index 000000000..6a4959422
--- /dev/null
+++ b/contrib/package/luci-addons/dist/etc/init.d/luci-fixtime
@@ -0,0 +1,10 @@
+#!/bin/sh /etc/rc.common
+START=5
+
+start() {
+ cat <<' EOF' | lua -l luci.fs -l luci.sys -
+ if (os.time() < 1000000000) then
+ os.execute('date -s ' .. os.date('%m%d%H%M%Y', luci.fs.mtime(luci.sys.libpath())))
+ end
+ EOF
+}