您现在的位置是:网站首页> 编程资料编程资料
svn服务器启动和svn服务器重启、停止等操作脚本分享_linux shell_
2023-05-26
345人已围观
简介 svn服务器启动和svn服务器重启、停止等操作脚本分享_linux shell_
复制代码 代码如下:
#!/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
您可能感兴趣的文章:
相关内容
- 25个好用的Shell脚本常用命令分享_linux shell_
- Shell脚本监控服务器在线状态和邮件报警的方法_linux shell_
- Shell脚本判断IP地址是否合法的方法_linux shell_
- MAC中用Shell脚本批量裁剪各种尺寸的App图标_linux shell_
- 在Shell命令行处理JSON数据的方法_linux shell_
- 用shell脚本在mysql表中批量插入数据的方法_linux shell_
- windows下写的shell脚本在linux执行出错的解决办法_linux shell_
- 用Shell脚本快速搭建Ubuntu下的Nodejs开发环境_linux shell_
- 用内置变量调试shell脚本的方法_linux shell_
- 一个测试下载速度的shell脚本_linux shell_
