1234567891011121314151617181920212223242526272829303132333435363738 |
- #!/bin/sh
- #PKG subversion
- #INIT 80
- . /etc/rc.conf
- case $1 in
- autostop) ;;
- autostart)
- test x"${svnserve:-NO}" = x"NO" && exit 0
- test x"$svnserve" = x"DAEMON" && test -x /bin/mksh && exec mksh -T- $0 start
- 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)
- kill $(pgrep -f /usr/bin/svnserve)
- ;;
- restart)
- sh $0 stop
- sh $0 start
- ;;
- *)
- echo "Usage: $0 {start|stop|restart}"
- ;;
- esac
- exit $?
|