luci_statistics 527 B

12345678910111213141516171819202122232425
  1. #!/bin/sh /etc/rc.common
  2. START=79
  3. start() {
  4. ### replace shipped config with symlink
  5. mkdir -p /var/etc
  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. ### create config
  11. /usr/bin/stat-genconfig > /var/etc/collectd.conf
  12. ### workaround broken permissions on /tmp
  13. chmod 1777 /tmp
  14. }
  15. restart() {
  16. ### regenerate config / prepare environment
  17. start
  18. ### restart collectd
  19. /etc/init.d/collectd restart
  20. }