1
0

subversion.init 954 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/bin/sh /etc/rc.common
  2. # Copyright (C) 2006-2016 OpenWrt.org
  3. START=50
  4. start_instance () {
  5. local section="$1"
  6. config_get path "$section" 'path'
  7. config_get port "$section" 'port'
  8. if [ ! -d "$path" ]; then
  9. echo "The subversion repository (${path}) does not exist."
  10. echo "Create a new repository and/or change the path in /etc/config/subversion"
  11. echo
  12. echo "Create a new subversion repository with:"
  13. echo " mkdir -p ${path}"
  14. echo " svnadmin create --fs-type fsfs ${path}"
  15. echo
  16. echo "Changing the path using UCI (default path is: /var/local/svn):"
  17. echo " uci set subversion.@[0].path="/srv/svn""
  18. echo " uci commit"
  19. echo " /etc/init.d/subversion restart"
  20. return 1
  21. fi
  22. service_start /usr/bin/svnserve -d --listen-port ${port} -r ${path}
  23. }
  24. start() {
  25. config_load 'subversion'
  26. config_foreach start_instance 'subversion'
  27. }
  28. stop() {
  29. SERVICE_SIG_STOP="INT" \
  30. service_stop /usr/bin/svnserve
  31. }