1
0
mirror of https://git.openwrt.org/feed/packages.git synced 2024-06-26 09:37:44 +02:00
openwrt-packages/net/subversion/files/subversion.init
Donald Rumata f69a37532b subversion: bring back from oldpackages and update to current version
Bring back Subversion from oldpackages and update to the latest version.
Create prerm script to stop subversion server and remove init script
on uninstall.

Signed-off-by: Donald Rumata <donald.rumata@gmail.com>
2016-06-11 01:30:46 -04:00

38 lines
954 B
Bash

#!/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
}