aboutsummaryrefslogtreecommitdiff
path: root/net/subversion/files/subversion.init
blob: 660a29762691ed8a1fb98af241b79f2f2d546c1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh /etc/rc.common
# Copyright (C) 2006-2016 OpenWrt.org

START=50

start_instance () {
	local section="$1"
	config_get path "$section" 'path'
	config_get port "$section" 'port'

	if [ ! -d "$path" ]; then
		echo "The subversion repository (${path}) does not exist."
		echo "Create a new repository and/or change the path in /etc/config/subversion"
		echo
		echo "Create a new subversion repository with:"
		echo "        mkdir -p ${path}"
		echo "        svnadmin create --fs-type fsfs ${path}"
		echo
		echo "Changing the path using UCI (default path is: /var/local/svn):"
		echo "        uci set subversion.@[0].path="/srv/svn""
		echo "        uci commit"
		echo "        /etc/init.d/subversion restart"
		return 1
	fi

	service_start /usr/bin/svnserve -d --listen-port ${port} -r ${path}
}

start() {
	config_load 'subversion'
	config_foreach start_instance 'subversion'
}

stop() {
	SERVICE_SIG_STOP="INT" \
	service_stop /usr/bin/svnserve
}