68a5cf97a5bf760f6634a7b2977b7d835d33cb9b
[project/luci.git] / applications / luci-statistics / root / etc / init.d / luci_statistics
1 #!/bin/sh /etc/rc.common
2 START=79
3
4 start() {
5 ### replace shipped config with symlink
6 if [ ! -L /etc/collectd.conf ]; then
7 test -f /etc/collectd.conf && mv /etc/collectd.conf /etc/collectd.conf.bak
8 ln -s /var/etc/collectd.conf /etc/collectd.conf
9 fi
10
11 ### create config
12 mkdir -p /var/etc
13 /usr/bin/stat-genconfig > /var/etc/collectd.conf
14
15 ### prepare rrdimg directory
16 if [ ! -L /www/rrdimg ]; then
17 imagepath="$(uci get luci_statistics.rrdtool.image_path)"
18 ln -s ${imagepath:-/tmp/rrdimg}/ /www/rrdimg
19 fi
20 }