复制代码 代码如下:
#!/bin/bash
case "$1" in
start)
svnserve -d -r /svndata
svnport=`netstat -natp | grep svnserve | awk -F: '{print $4}' | awk 'NR==1'`
if [ $svnport -eq 3690 ]
then
echo "SVN Server Already Runnning. Port:3690"
else
echo "SVN Server Does Not Start"
fi
reload)
svnport=`netstat -natp | grep svnserve | awk -F: '{print $4}' | awk 'NR==1'`
if [ $svnport -eq 3690 ]
then
killall svnserve && svnserve -d -r /svndata
echo "Reload OK"
else
echo "SVN Server Is Not Running"
fi
stop)
killall svnserve
echo "SVN Server Has Been Stopped"
status)
svnport=`netstat -natp | grep svnserve | awk -F: '{print $4}' | awk 'NR==1'`
pid=`ps aux | grep svnserve | grep -v "grep" | awk '{print $2}'`
if [ $svnport -eq 3690 ]
then
echo "SVN Server (pid:$pid) 正在运行..."
else
echo "SVN Server 停止运行..."
fi
*)
echo "$0: Usage: $0 {start|status|stop|reload}"
exit 1
esac
【svn服务器启动和svn服务器重启、停止等操作脚本分享】相关文章:
★ Linux下实现SSH免密码登录和实现秘钥的管理、分发、部署SHELL脚本分享
★ 获取服务器信息的Shell脚本分享(ubuntu、centos测试通过)
★ Ubuntu下定时提交代码到SVN服务器的Shell脚本分享
★ 阿里云主机一键安装lamp、lnmp环境的shell脚本分享
★ 一个简洁的全自动安装LNMP服务器环境的Shell脚本分享