cupsd.init 504 B

1234567891011121314151617181920212223242526272829
  1. #!/bin/sh
  2. #PKG cups
  3. #INIT 60
  4. . /etc/rc.conf
  5. case $1 in
  6. autostop) ;;
  7. autostart)
  8. test x"${cups:-NO}" = x"NO" && exit 0
  9. exec sh $0 start
  10. ;;
  11. start)
  12. [ -d /var/cache/cups ] || mkdir -p /var/cache/cups
  13. [ -d /var/cups ] || mkdir -p /var/cups/tmp
  14. [ -d /var/cups/spool/cups/tmp ] || mkdir -p /var/cups/spool/cups/tmp
  15. /usr/sbin/cupsd -c /etc/cups/cupsd.conf
  16. ;;
  17. stop)
  18. kill $(pgrep -f /usr/sbin/cupsd)
  19. ;;
  20. restart)
  21. sh $0 stop
  22. sh $0 start
  23. ;;
  24. *)
  25. echo "Usage: $0 {start | stop | restart}"
  26. ;;
  27. esac
  28. exit $?