rrdcollect.init 547 B

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