pdnsd.init 581 B

12345678910111213141516171819202122232425262728293031323334
  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. test x"$pdnsd" = x"DAEMON" && test -x /bin/mksh && exec mksh -T- $0 start
  10. exec sh $0 start
  11. ;;
  12. start)
  13. [ -f /etc/pdnsd.conf ] || exit
  14. mkdir -p /var/cache/pdnsd
  15. touch /var/cache/pdnsd/pdnsd.cache
  16. # this allows for strict_setuid
  17. chown -R nobody:nogroup /var/cache/pdnsd
  18. /usr/sbin/pdnsd -d
  19. ;;
  20. stop)
  21. kill $(pgrep -f /usr/sbin/pdnsd)
  22. ;;
  23. restart)
  24. sh $0 stop
  25. sleep 1
  26. sh $0 start
  27. ;;
  28. *)
  29. echo "Usage: $0 {start | stop | restart}"
  30. exit 1
  31. ;;
  32. esac
  33. exit $?