rrdcollect.init 534 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/sh
  2. #FWINIT 90
  3. . /etc/rc.conf
  4. LIB_D=/var/lib/rrdcollect
  5. CGI_S=$LIB_D/rrd.cgi
  6. RRD_D=$LIB_D/rrd
  7. RRD_F=$(find $RRD_D -name "*.rrd" 2>/dev/null)
  8. case $1 in
  9. autostop) ;;
  10. autostart)
  11. test x"${rrdcollect:-NO}" = x"NO" && exit 0
  12. exec sh $0 start
  13. ;;
  14. start)
  15. [ -d $LIB_D/img ] || mkdir -p $LIB_D/img
  16. [ -n "$RRD_F" ] || /usr/bin/rrd.sh init
  17. [ -x $CGI_S ] || /usr/bin/rrd.sh cgi
  18. rrdcollect
  19. ;;
  20. stop)
  21. killall rrdcollect
  22. ;;
  23. restart)
  24. sh $0 stop
  25. sh $0 start
  26. ;;
  27. *)
  28. echo "Usage: $0 {start | stop | restart}"
  29. exit 1
  30. ;;
  31. esac
  32. exit $?