svnserve.init 781 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/bin/sh
  2. #PKG subversion
  3. #INIT 80
  4. . /etc/rc.conf
  5. case $1 in
  6. autostop) ;;
  7. autostart)
  8. test x"${svnserve:-NO}" = x"NO" && exit 0
  9. test x"$svnserve" = x"DAEMON" && test -x /bin/mksh && exec mksh -T- $0 start
  10. exec sh $0 start
  11. ;;
  12. start)
  13. if [[ ! -d $svnserve_path ]]; then
  14. echo "The subversion repository ($svnserve_path) does not exist."
  15. echo "Create a new repository and/or change the path in /etc/rc.conf"
  16. echo
  17. echo "Create a new subversion repository with:"
  18. echo " mkdir -p $svnserve_path"
  19. echo " svnadmin create --fs-type fsfs $svnserve_path"
  20. echo
  21. exit 1
  22. fi
  23. /usr/bin/svnserve -d -r $svnserve_path
  24. ;;
  25. stop)
  26. kill $(pgrep -f /usr/bin/svnserve)
  27. ;;
  28. restart)
  29. sh $0 stop
  30. sh $0 start
  31. ;;
  32. *)
  33. echo "Usage: $0 {start|stop|restart}"
  34. ;;
  35. esac
  36. exit $?