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