svnserve.init 674 B

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