packages/net/subversion/files/subversion.init
nico 8c0b7b5890 packages/subversion: use new service functions
git-svn-id: svn://svn.openwrt.org/openwrt/packages@29067 3c298f89-4303-0410-b956-a3cf2f4a3e73
2011-11-13 22:16:02 +00:00

38 lines
952 B
Bash

#!/bin/sh /etc/rc.common
# Copyright (C) 2006-2011 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 /srv"
echo " svnadmin create --fs-type fsfs /srv/svn"
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
}