updated on Tue Jan 17 08:05:08 UTC 2012
[aur-mirror.git] / subversion-serf / svnserve
blob670fee742afa3c0ec5febdc9e48071c13aa9d028
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
5 . /etc/conf.d/svnserve
7 PID=`pidof -o %PPID /usr/bin/svnserve`
8 case "$1" in
9 start)
10 stat_busy "Starting svnserve"
11 if [ -z "$PID" ]; then
12 if [ -n "$SVNSERVE_USER" ]; then
13 su -s '/bin/sh' $SVNSERVE_USER -c "/usr/bin/svnserve -d $SVNSERVE_ARGS" &
14 else
15 /usr/bin/svnserve -d $SVNSERVE_ARGS &
18 if [ ! -z "$PID" -o $? -gt 0 ]; then
19 stat_fail
20 else
21 add_daemon svnserve
22 stat_done
25 stop)
26 stat_busy "Stopping svnserve"
27 [ ! -z "$PID" ] && kill $PID &> /dev/null
28 if [ $? -gt 0 ]; then
29 stat_fail
30 else
31 rm_daemon svnserve
32 stat_done
35 restart)
36 $0 stop
37 sleep 1
38 $0 start
41 echo "usage: $0 {start|stop|restart}"
42 esac