pdnsd.init 506 B

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/sh
  2. #PKG pdnsd
  3. #INIT 60
  4. . /etc/rc.conf
  5. case $1 in
  6. autostop) ;;
  7. autostart)
  8. test x"${pdnsd:-NO}" = x"NO" && exit 0
  9. exec sh $0 start
  10. ;;
  11. start)
  12. [ -f /etc/pdnsd.conf ] || exit
  13. mkdir -p /var/cache/pdnsd
  14. touch /var/cache/pdnsd/pdnsd.cache
  15. # this allows for strict_setuid
  16. chown -R nobody:nogroup /var/cache/pdnsd
  17. /usr/sbin/pdnsd -d
  18. ;;
  19. stop)
  20. kill $(pgrep -f /usr/sbin/pdnsd)
  21. ;;
  22. restart)
  23. sh $0 stop
  24. sleep 1
  25. sh $0 start
  26. ;;
  27. *)
  28. echo "Usage: $0 {start | stop | restart}"
  29. exit 1
  30. ;;
  31. esac
  32. exit $?