applications/luci-statistics: make it run ootb again
authorJo-Philipp Wich <jow@openwrt.org>
Sun, 28 Feb 2010 00:19:58 +0000 (00:19 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sun, 28 Feb 2010 00:19:58 +0000 (00:19 +0000)
applications/luci-statistics/root/etc/config/luci_statistics
applications/luci-statistics/root/etc/uci-defaults/luci-statistics

index f6d870e0519ea2681474fc6b1e93330196cccd4b..f418f192667441454b323b59fdc5547e49e67606 100644 (file)
@@ -8,7 +8,7 @@ config 'statistics' 'collectd'
        option 'Include' '/etc/collectd/conf.d'
        option 'PIDFile' '/var/run/collectd.pid'
        option 'PluginDir' '/usr/lib/collectd'
-       option 'TypesDB' '/usr/lib/collectd/types.db'
+       option 'TypesDB' '/usr/share/collectd/types.db'
        option 'Interval' '30'
        option 'ReadThreads' '2'
 
index f89366f1becf2fec18b3a3e55dcd1589562a6216..9453dc1d0d6c9896e4172ec36ddc1cbff40e7c0e 100644 (file)
@@ -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