#!/bin/sh
### BEGIN INIT INFO
# Provides: svn-updater
# Required-Start: $syslog $local_fs $remote_fs mysql
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
### END INIT INFO
test -x "/usr/local/bin/svn-updater" || {
echo "svn-updater not found"
exit 1
}
case "$1" in
start)
echo "Starting svn-updater"
su svnup -c "/usr/local/bin/svn-updater" &
;;
stop)
echo "Stopping svn-updater"
killall -u svnup
;;
reload|restart|force-reload)
echo "Stopping svn-updater"
killall -u svnup
sleep 1
echo "Starting svn-updater"
su svnup -c "/usr/local/bin/svn-updater" &
;;
*)
echo "Usage: svn-updater {start|stop|restart|force-reload}" >&2
exit 1
;;
esac