2
0

luci_statistics 652 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/sh /etc/rc.common
  2. START=79
  3. USE_PROCD=1
  4. service_triggers()
  5. {
  6. procd_add_reload_trigger "luci_statistics"
  7. }
  8. start_service() {
  9. ### replace shipped config with symlink
  10. mkdir -p /var/etc
  11. if [ ! -L /etc/collectd.conf ]; then
  12. test -f /etc/collectd.conf && mv /etc/collectd.conf /etc/collectd.conf.bak
  13. ln -s /var/etc/collectd.conf /etc/collectd.conf
  14. fi
  15. ### create config
  16. /usr/bin/stat-genconfig > /var/etc/collectd.conf
  17. ### workaround broken permissions on /tmp
  18. chmod 1777 /tmp
  19. }
  20. reload_service() {
  21. restart "$@"
  22. }
  23. restart() {
  24. ### regenerate config / prepare environment
  25. start
  26. ### restart collectd
  27. /etc/init.d/collectd restart
  28. }