lprng-init 944 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/sbin/openrc-run
  2. # Copyright 1999-2012 Gentoo Foundation
  3. # Distributed under the terms of the GNU General Public License v2
  4. depend() {
  5. need net
  6. }
  7. checkconfig() {
  8. if [ ! -e /etc/lprng/lpd.conf ] ; then
  9. eerror "You need an /etc/lprng/lpd.conf file first"
  10. eerror "There is a sample in /usr/share/doc/LPRng"
  11. return 1
  12. fi
  13. if [ ! -e /etc/lprng/printcap ] ; then
  14. eerror "You need an /etc/lprng/printcap file first"
  15. eerror "There is a sample in /usr/share/doc/LPRng"
  16. return 1
  17. fi
  18. if [ ! -e /etc/lprng/lpd.perms ] ; then
  19. eerror "You need an /etc/lprng/lpd.perms file first"
  20. eerror "There is a sample in /usr/share/doc/LPRng"
  21. return 1
  22. fi
  23. }
  24. start() {
  25. checkconfig || return 1
  26. ebegin "Starting lpd"
  27. start-stop-daemon --start --pidfile "/var/run/lpd.515" --quiet --exec /usr/sbin/lpd
  28. eend $?
  29. }
  30. stop() {
  31. ebegin "Stopping lpd"
  32. start-stop-daemon --stop --pidfile "/var/run/lpd.515" --quiet --exec /usr/sbin/lpd
  33. eend $?
  34. }