applications/luci-statistics: init fixes

This commit is contained in:
Jo-Philipp Wich 2010-02-28 20:59:23 +00:00
parent 56b3fb4ef7
commit 979fa033ea

View file

@ -1,27 +1,6 @@
#!/bin/sh /etc/rc.common #!/bin/sh /etc/rc.common
START=79 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() { start() {
### replace shipped config with symlink ### replace shipped config with symlink
if [ ! -L /etc/collectd.conf ]; then if [ ! -L /etc/collectd.conf ]; then
@ -34,15 +13,13 @@ start() {
/usr/bin/stat-genconfig > /var/etc/collectd.conf /usr/bin/stat-genconfig > /var/etc/collectd.conf
### prepare rrdimg directory ### prepare rrdimg directory
if [ "$(uci get luci_statistics.rrdtool.image_path 2>/dev/null)" != "$(uci get lucid.rrdimg.physical 2>/dev/null)" ]; then if [ -f /etc/config/lucid ] && [ -x /etc/init.d/lucid ] && /etc/init.d/lucid enabled && \
uci set lucid.rrdimg.physical=$(uci get luci_statistics.rrdtool.image_path) [ "$(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 uci commit lucid
/etc/init.d/lucid restart /etc/init.d/lucid restart
fi fi
### flush LuCI index cache
test -f /var/luci-indexcache && rm /var/luci-indexcache
### workaround broken permissions on /tmp ### workaround broken permissions on /tmp
chmod 1777 /tmp chmod 1777 /tmp
} }