Jul 1

[原]使用Subversion的svn协议访问 晴

linuxing , 17:22 , 网络服务 » 常见服务 , 评论(0) , 引用(0) , 阅读(35141) , Via 本站原创 | |

四、svnd服务脚本
源码:
#!/bin/bash
#
# Init file for SVNserve server daemon
#
# chkconfig: 2345 55 25
# description: SVNserve server daemon

# source function library
. /etc/rc.d/init.d/functions
# pull in sysconfig settings
[ -f /etc/sysconfig/svnd ] && . /etc/sysconfig/svnd

[ -z "$SVN_HOME" ] && SVN_HOME="/var/svn/repos"
SVNSERVE="/usr/bin/svnserve"
prog="svnd"
RETVAL=0
if [ ! -f $SVNSERVE ]; then
  echo "svnserve didn't fount."
  exit
fi
if [ ! -e $SVN_HOME ] || [ ! -d $SVN_HOME ];then
  mkdir -p $SVN_HOME
  if [ $? -ne 0 ];then
    echo "Create $SVN_HOME directory failure."
    exit 1
  fi
fi
case "$1" in
  start)
    echo -n "Starting $prog:"
    $SVNSERVE -d -r $SVN_HOME && success || failure
    RETVAL=$?
    [ "$RETVAL" = "$?" ] && touch /var/lock/subsys/svn
    echo
    ;;
  stop)
    echo -n $"Stopping $prog:"
    if [ -n "`pidofproc $SVNSERVE`" ];then
      killproc $SVNSERVE
    else
      failure $"Stopping $prog"
    fi
    RETVAL=$?
    if [ "x$runlevel" = x0 -o "x$runlevel" = x6 ] ; then
      killall $prog 2>/dev/null
    fi
    [ "$RETVAL" = 0 ] && rm -f /var/lock/subsys/svn
    echo
    ;;
  restart)
    $0 stop
    $0 start
    ;;
  status)
    status $SVNSERVE
    ;;
  *)
    echo "Usage: svn { start|stop|restart|status } "
    exit 1
esac
内文分页: [1] [2]
Tags:
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]