summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-statistics/root/etc/uci-defaults
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2010-02-28 00:19:58 +0000
committerJo-Philipp Wich <jow@openwrt.org>2010-02-28 00:19:58 +0000
commit56b3fb4ef779b9f3fa76ad6786b02ad02eff975a (patch)
treeda22b6e096092ad15b2f06a561860a2f68478eaa /applications/luci-statistics/root/etc/uci-defaults
parentde8a2d07675c3e48c249878437063e62f68f10d7 (diff)
applications/luci-statistics: make it run ootb again
Diffstat (limited to 'applications/luci-statistics/root/etc/uci-defaults')
-rw-r--r--applications/luci-statistics/root/etc/uci-defaults/luci-statistics30
1 files changed, 29 insertions, 1 deletions
diff --git a/applications/luci-statistics/root/etc/uci-defaults/luci-statistics b/applications/luci-statistics/root/etc/uci-defaults/luci-statistics
index f89366f1be..9453dc1d0d 100644
--- a/applications/luci-statistics/root/etc/uci-defaults/luci-statistics
+++ b/applications/luci-statistics/root/etc/uci-defaults/luci-statistics
@@ -1,7 +1,35 @@
#!/bin/sh
-uci batch <<-EOF
+# register commit handler
+[ -f /etc/config/ucitrack ] && \
+[ "$(uci get ucitrack.@luci_statistics[0] 2>/dev/null)" != "luci_statistics" ] && \
+uci batch <<-EOF >/dev/null 2>/dev/null
add ucitrack luci_statistics
set ucitrack.@luci_statistics[-1].init=luci_statistics
commit ucitrack
EOF
+
+# register LuCId virtual path handler
+[ -f /etc/config/lucid ] && \
+[ "$(uci get lucid.statistics 2>/dev/null)" != "DirectoryPublisher" ] && \
+uci batch <<-EOF >/dev/null 2>/dev/null
+ set lucid.statistics=DirectoryPublisher
+ set lucid.statistics.name='RRDTool Image Cache'
+ set lucid.statistics.physical=/tmp/rrdimg
+ set lucid.statistics.virtual=/rrdimg
+ set lucid.statistics.domain=''
+
+ add_list lucid.http.publisher=statistics
+ add_list lucid.https.publisher=statistics
+
+ commit lucid
+EOF
+
+# symlink for busybox httpd
+[ -x /usr/sbin/httpd ] && [ ! -h /www/rrdimg ] && \
+ ln -s /tmp/rrdimg /www/rrdimg
+
+# restart LuCId service
+[ -x /etc/init.d/lucid ] && /etc/init.d/lucid enabled && /etc/init.d/lucid restart
+
+exit 0