summaryrefslogtreecommitdiff
path: root/package/subversion/files/svnserve.init
blob: a52fdb43a0bb91a9f44f0b3d933a4dc164c41ace (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
38
#!/bin/sh
#PKG subversion
#INIT 80

. /etc/rc.conf

case $1 in
autostop) ;;
autostart)
	[[ $svnserve = YES ]] || exit 0
	exec sh $0 start
	;;
start)
	if [[ ! -d $svnserve_path ]]; then
		echo "The subversion repository ($svnserve_path) does not exist."
		echo "Create a new repository and/or change the path in /etc/rc.conf"
		echo
		echo "Create a new subversion repository with:"
		echo "        mkdir -p $svnserve_path"
		echo "        svnadmin create --fs-type fsfs $svnserve_path"
		echo
		exit 1
	fi

	/usr/bin/svnserve -d -r $svnserve_path
	;;
stop)
	killall svnserve
	;;
restart)
	sh $0 stop
	sh $0 start
	;;
*)
	echo "Usage: $0 {start|stop|restart}"
	;;
esac
exit $?