rc.main 709 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #! /bin/sh -
  2. #
  3. # cups-browsed/rc.main
  4. #
  5. # A daemon for browsing the Bonjour broadcasts of shared, remote CUPS printers.
  6. #
  7. # Redirects the standard error to the standard output
  8. exec 2>&1
  9. TARGET="$1"
  10. SVNAME="${2:-cups-browsed}"
  11. start()
  12. {
  13. echo "*** ${SVNAME}: Starting cups-browsed ..."
  14. # Check first if 'cupsd' is running before to run 'cups-browsed'
  15. perpok cupsd || exit $?
  16. exec /usr/sbin/cups-browsed -d
  17. }
  18. reset()
  19. {
  20. case $3 in
  21. exit)
  22. echo "*** ${SVNAME}: Exited status $4"
  23. ;;
  24. signal)
  25. echo "*** ${SVNAME}: Killed on signal $5"
  26. ;;
  27. *)
  28. echo "*** ${SVNAME}: Stopped (${3})"
  29. ;;
  30. esac
  31. }
  32. # Branch to target
  33. eval ${TARGET} "$@"