dansguardian.init 581 B

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/sh
  2. #PKG dansguardian
  3. #INIT 80
  4. . /etc/rc.conf
  5. case $1 in
  6. autostop) ;;
  7. autostart)
  8. test x"${dansguardian:-NO}" = x"NO" && exit 0
  9. test x"$dansguardian" = x"DAEMON" && test -x /bin/mksh && exec mksh -T- $0 start
  10. exec sh $0 start
  11. ;;
  12. start)
  13. if [ ! -f /var/log/dansguardian-access.log ];then
  14. touch /var/log/dansguardian-access.log
  15. chown proxy:proxy /var/log/dansguardian-access.log
  16. fi
  17. /usr/sbin/dansguardian
  18. ;;
  19. stop)
  20. kill $(pgrep -f /usr/sbin/dansguardian)
  21. ;;
  22. restart)
  23. sh $0 stop
  24. sh $0 start
  25. ;;
  26. *)
  27. echo "usage: $0 {start | stop | restart}"
  28. exit 1
  29. esac
  30. exit $?