summaryrefslogtreecommitdiffhomepage
path: root/applications
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2010-02-28 20:59:23 +0000
committerJo-Philipp Wich <jow@openwrt.org>2010-02-28 20:59:23 +0000
commit979fa033eab95320eda0b18ad6e4af0c67397dd6 (patch)
treed81368e2ea6b4882135835d99b8f179ea51fb6c2 /applications
parent56b3fb4ef779b9f3fa76ad6786b02ad02eff975a (diff)
applications/luci-statistics: init fixes
Diffstat (limited to 'applications')
-rwxr-xr-xapplications/luci-statistics/root/etc/init.d/luci_statistics29
1 files changed, 3 insertions, 26 deletions
diff --git a/applications/luci-statistics/root/etc/init.d/luci_statistics b/applications/luci-statistics/root/etc/init.d/luci_statistics
index b33536441..936f3a63c 100755
--- a/applications/luci-statistics/root/etc/init.d/luci_statistics
+++ b/applications/luci-statistics/root/etc/init.d/luci_statistics
@@ -1,27 +1,6 @@
#!/bin/sh /etc/rc.common
START=79
-boot() {
- ### prepare publisher
- if ! uci get lucid.rrdimg >/dev/null 2>/dev/null; then
- uci batch <<-EOF
-set lucid.rrdimg=DirectoryPublisher
-set lucid.rrdimg.name='Statistics Images'
-set lucid.rrdimg.physical=/tmp/rrdimg
-set lucid.rrdimg.virtual=/rrdimg
-set lucid.rrdimg.domain=''
-
-add_list lucid.http.publisher=rrdimg
-add_list lucid.https.publisher=rrdimg
-
-commit lucid
-EOF
- /etc/init.d/lucid restart
- fi
-
- start
-}
-
start() {
### replace shipped config with symlink
if [ ! -L /etc/collectd.conf ]; then
@@ -34,15 +13,13 @@ start() {
/usr/bin/stat-genconfig > /var/etc/collectd.conf
### prepare rrdimg directory
- if [ "$(uci get luci_statistics.rrdtool.image_path 2>/dev/null)" != "$(uci get lucid.rrdimg.physical 2>/dev/null)" ]; then
- uci set lucid.rrdimg.physical=$(uci get luci_statistics.rrdtool.image_path)
+ if [ -f /etc/config/lucid ] && [ -x /etc/init.d/lucid ] && /etc/init.d/lucid enabled && \
+ [ "$(uci get luci_statistics.rrdtool.image_path 2>/dev/null)" != "$(uci get lucid.statistics.physical 2>/dev/null)" ]; then
+ uci set lucid.statistics.physical=$(uci get luci_statistics.rrdtool.image_path)
uci commit lucid
/etc/init.d/lucid restart
fi
- ### flush LuCI index cache
- test -f /var/luci-indexcache && rm /var/luci-indexcache
-
### workaround broken permissions on /tmp
chmod 1777 /tmp
}