#!/bin/bash
(一定要寫的,說明下面的內容是程序)
# description: Svnserve auto start-stop script.
# chkconfig: - 20 80
(以上兩句不加的話無法加入chkconfig中)
SVN_HOME=/var/svn/repos
if [ ! -f "/usr/bin/svnserve" ]
(這兩句話什麼作用我也不太清楚)
then
echo "svnserver startup: cannot start"
(顯示輸出內容)
exit
fi
case "$1" in
start)
echo "Starting svnserve..."
svnserve -d -r /var/gftech/subversion/repos
(以上爲運行程序)
echo "Finished!"
;;
stop)
echo "Stoping svnserve..."
killall svnserve
(因爲svnserve本身沒有關閉命令,所以使用)
echo "Finished!"
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: svn { start | stop | restart } "
exit 1
esac