admin管理员组文章数量:1124021
right now I am running B2Bi Stop and B2B Start script separately. B2Bi is the name of my application. if I get the B2Bi restart script then I will not stop and start separately. I want to write a single script like below:
Stop (./B2Bi stop)
Check Status(./B2Bi status)
If not stopped yet sleep 30 Sec
Check Status again
If not Stopped yet sleep 30 Sec
Check Status again
If not Stopped yet then Exit
Else start(./B2Bi start)
--------------
Usage: B2Bi [commands]
Commands include:
start, Starts B2Bi in the background.
stop, Stops B2Bi.
status, Displays whether B2Bi is running or
stopped.
the output of status command as below
./B2Bi status
"There are 4 active nodes
awsu1-07lawa01q_te: Started
awsu1-07lawa01q_b2b: Started
awsu1-07lawa01q_cn: Started
awsu1-07lawa01q_rest: Started
Interchange status is : running"
OR
"There are 4 active nodes
awsu1-07lawa01q_te: Stopped
awsu1-07lawa01q_b2b: Stopped
awsu1-07lawa01q_cn: Stopped
awsu1-07lawa01q_rest: Stopped
Interchange status is : stop"
I need to grep for "Stopped" string in B2Bi Status, if stopped string found then run the next Start command else what to 30 Sec to re-check
i need the shell script
本文标签: how to code shell script to perform custom restartStack Overflow
版权声明:本文标题:how to code shell script to perform custom restart - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736610631a1945433.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论