仓酷云

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 1043|回复: 9
打印 上一主题 下一主题

[shell编程] 给大家带来shell 编程条记完成多个使用步伐单文件运转

[复制链接]
冷月葬花魂 该用户已被删除
跳转到指定楼层
楼主
发表于 2015-1-14 20:14:45 | 显示全部楼层 回帖奖励 |倒序浏览 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
欢迎大家来到仓酷云论坛!open_file.sh:
按次运转liferay,jira,confluence,bamboo,fisheye,可单个运转,可检测某个步伐是不是已运转

#!/bin/sh
#openfile:liferay,jira,confluence,bamboo,fisheye
#portrunning
port_l=`netstat-an|grepLISTEN|grep:8082`
port_j=`netstat-an|grepLISTEN|grep:8088`
port_c=`netstat-an|grepLISTEN|grep:8090`
port_b=`netstat-an|grepLISTEN|grep:8085`
port_f=`netstat-an|grepLISTEN|grep:8060`
#openliferay
cd/usr/local/atlassian/liferay/tomcat-7.0.27/bin
if["$port_l"!=""];then
echo"=================liferayisruning!================="
else
if[$(whoami)=="root"];then
shstartup.sh
else
echo"w4u.com.au"|sudoshstartup.sh
fi
wait
port_ll=`netstat-an|grepLISTEN|grep:8082`
if["$port_ll"==""];then
echo"=================liferayrunfailed!exitopenfile================="
echo"=================jira,confluence,bamboo,fisheyenostart!================="
exit
fi
fi
#openjira
cd/usr/local/atlassian/jira/bin
if["$port_j"!=""];then
echo"=================jiraisruning!================"
else
if[$(whoami)=="root"];then
rm-rf/var/atlassian/application-data/jira/plugins/.osgi-plugins/felix/felix-cache
echo"=================cleanjiracachecomplete!================"
rm/var/atlassian/application-data/jira/.jira-home.lock
shstart-jira.sh
else
echo"w4u.com.au"|sudoshstart-jira.sh
fi
wait
port_jj=`netstat-an|grepLISTEN|grep:8082`
if["$port_jj"==""];then
echo"=================jirarunfailed!exitopenfile================="
echo"=================confluence,bamboo,fisheyenostart!================="
exit
fi
fi
#openconfluence
cd/usr/local/atlassian/confluence/bin
if["$port_c"!=""];then
echo"=================confluenceisruning!================"
else
if[$(whoami)=="root"];then
shstartup.sh
else
echo"w4u.com.au"|sudoshstartup.sh
fi
wait
port_cc=`netstat-an|grepLISTEN|grep:8082`
if["$port_cc"==""];then
echo"=================confluencerunfailed!exitopenfile================="
echo"=================bamboo,fisheyenostart!================="
exit
fi
fi
#openbamboo
cd/usr/local/atlassian/bamboo
if["$port_b"!=""];then
echo"=================bambooisruning!================"
else
if[$(whoami)=="root"];then
shbamboo.shstart
else
echo"w4u.com.au"|sudoshbamboo.shstart
fi
wait
port_bb=`netstat-an|grepLISTEN|grep:8082`
if["$port_bb"==""];then
echo"=================bamboorunfailed!exitopenfile================="
echo"=================fisheyenostart!================="
exit
fi
fi
#openfisheye
cd/usr/local/atlassian/fecru/bin
if["$port_f"!=""];then
echo"=================fisheyeisruning!================"
else
if[$(whoami)=="root"];then
shstart.sh
else
echo"w4u.com.au"|sudoshstart.sh
fi
wait
port_ff=`netstat-an|grepLISTEN|grep:8082`
if["$port_ff"==""];then
echo"=================fisheyerunfailed!exitopenfile================="
exit
fi
fi
欢迎大家来到仓酷云论坛!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|仓酷云 鄂ICP备14007578号-2

GMT+8, 2024-5-26 02:30

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表