first commit

This commit is contained in:
iProbe 2022-10-18 16:59:37 +08:00
commit ba848e218d
1001 changed files with 152333 additions and 0 deletions

View file

@ -0,0 +1,229 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="tool" content="leanote-desktop-app">
<title>mqaction-v1.sh</title>
<style>
*{font-family:"lucida grande","lucida sans unicode",lucida,helvetica,"Hiragino Sans GB","Microsoft YaHei","WenQuanYi Micro Hei",sans-serif;}
body {
margin: 0;
}
/*公用文字样式*/
h1{font-size:30px}h2{font-size:24px}h3{font-size:18px}h4{font-size:14px}
.note-container{
width:850px;
margin:auto;
padding: 10px 20px;
box-shadow: 1px 1px 10px #eee;
}
#title {
margin: 0;
}
table {
margin-bottom: 16px;
border-collapse: collapse;
}
table th, table td {
padding: 6px 13px;
border: 1px solid #ddd;
}
table th {
font-weight: bold;
}
table tr {
background-color: none;
border-top: 1px solid #ccc;
}
table tr:nth-child(2n) {
background-color: rgb(247, 247, 249);
}
.mce-item-table, .mce-item-table td, .mce-item-table th, .mce-item-table caption {
border: 1px solid #ddd;
border-collapse: collapse;
padding: 6px 13px;
}
blockquote {
border-left-width:10px;
background-color:rgba(128,128,128,0.05);
border-top-right-radius:5px;
border-bottom-right-radius:5px;
padding:15px 20px;
border-left:5px solid rgba(128,128,128,0.075);
}
blockquote p {
margin-bottom:1.1em;
font-size:1em;
line-height:1.45
}
blockquote ul:last-child,blockquote ol:last-child {
margin-bottom:0
}
pre {
padding: 18px;
background-color: #f7f7f9;
border: 1px solid #e1e1e8;
border-radius: 3px;
display: block;
}
code {
padding: 2px 4px;
font-size: 90%;
color: #c7254e;
white-space: nowrap;
background-color: #f9f2f4;
border-radius: 4px;
}
.footnote {
vertical-align: top;
position: relative;
top: -0.5em;
font-size: .8em;
}
hr {
margin:2em 0
}
img {
max-width:100%
}
pre {
word-break:break-word
}
p,pre,pre.prettyprint,blockquote {
margin:0 0 1.1em
}
hr {
margin:2em 0
}
img {
max-width:100%
}
.sequence-diagram,.flow-chart {
text-align:center;
margin-bottom:1.1em
}
.sequence-diagram text,.flow-chart text {
font-size:15px !important;
font-family:"Source Sans Pro",sans-serif !important
}
.sequence-diagram [fill="#ffffff"],.flow-chart [fill="#ffffff"] {
fill:#f6f6f6
}
.sequence-diagram [stroke="#000000"],.flow-chart [stroke="#000000"] {
stroke:#3f3f3f
}
.sequence-diagram text[stroke="#000000"],.flow-chart text[stroke="#000000"] {
stroke:none
}
.sequence-diagram [fill="#000"],.flow-chart [fill="#000"],.sequence-diagram [fill="#000000"],.flow-chart [fill="#000000"],.sequence-diagram [fill="black"],.flow-chart [fill="black"] {
fill:#3f3f3f
}
ul,ol {
margin-bottom:1.1em
}
ul ul,ol ul,ul ol,ol ol {
margin-bottom:1.1em
}
kbd {
padding:.1em .6em;
border:1px solid rgba(63,63,63,0.25);
-webkit-box-shadow:0 1px 0 rgba(63,63,63,0.25);
box-shadow:0 1px 0 rgba(63,63,63,0.25);
font-size:.7em;
font-family:sans-serif;
background-color:#fff;
color:#333;
border-radius:3px;
display:inline-block;
margin:0 .1em;
white-space:nowrap
}
.toc ul {
list-style-type:none;
margin-bottom:15px
}
</style>
<!-- 该css供自定义样式 -->
<link href="../leanote-html.css" rel="stylesheet">
</head>
<body>
<div class="note-container">
<h1 class="title" id="leanote-title">mqaction-v1.sh</h1>
<div class="content-html" id="leanote-content"><pre id="leanote_ace_1509518437791_0" class="brush:sh ace-tomorrow">#!/bin/bash
#20171025
#Service_name=(Users Orders Capital Sysaccount Products Trusteeship)
#Users_port=9611
#Orders_port=9615
#Capital_port=9617
#Sysaccount_port=9618
#Products_port=9619
#Trusteeship_port=9620
declare -A Service
Service=([Users]=9611 [Orders]=9615 [Capital]=9617 [Sysaccount]=9618 [Products]=9619 [Trusteeship]=9620)
# source function library
. /etc/rc.d/init.d/functions
action()
{
does=$1
server=$2
SPORT=${Service[$server]}
is_exists=`netstat -anltp| grep $SPORT`
if [ x != x"$is_exists" ];then
if [ $does == 'start' ];then
echo "The $server already start!"
elif [ $does == 'stop' ];then
lsof -i:$SPORT| grep php| grep -v grep | awk '{print $2}'|xargs kill -9
elif [ $does == 'restart' ];then
action stop $server
action start $server
elif [ $does == 'status' ];then
echo "The $server running..."
fi
else
if [ $does == 'start' ];then
cd /data/htdocs/v/ServiceModule/$server
nohup /usr/local/php7/bin/php mqconsumer.php &gt;/dev/null 2&gt;&amp;1 &amp;
#cd /data/htdocs/v/ServiceModule/$server &amp;&amp; nohup /usr/local/php7/bin/php mqconsumer.php &gt;/dev/null &amp;
elif [ $does == 'stop' ];then
echo "The $server already stop!"
elif [ $does == 'restart' ];then
action stop $server
action start $server
elif [ $does == 'status' ];then
echo "The $server stopping..."
fi
fi
}
cycle()
{
doing=$1
sername=$2
if [ $sername == 'all' ];then
for key in $(echo ${!Service[*]});do
action $doing $key
done
else
action $doing $sername
fi
}
cycle $1 $2
</pre><p><br data-mce-bogus="1"></p></div>
</div>
<!-- 该js供其它处理 -->
<script src="../leanote-html.js"></script>
</body>
</html>

View file

@ -0,0 +1,235 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="tool" content="leanote-desktop-app">
<title>mqaction-v2.sh</title>
<style>
*{font-family:"lucida grande","lucida sans unicode",lucida,helvetica,"Hiragino Sans GB","Microsoft YaHei","WenQuanYi Micro Hei",sans-serif;}
body {
margin: 0;
}
/*公用文字样式*/
h1{font-size:30px}h2{font-size:24px}h3{font-size:18px}h4{font-size:14px}
.note-container{
width:850px;
margin:auto;
padding: 10px 20px;
box-shadow: 1px 1px 10px #eee;
}
#title {
margin: 0;
}
table {
margin-bottom: 16px;
border-collapse: collapse;
}
table th, table td {
padding: 6px 13px;
border: 1px solid #ddd;
}
table th {
font-weight: bold;
}
table tr {
background-color: none;
border-top: 1px solid #ccc;
}
table tr:nth-child(2n) {
background-color: rgb(247, 247, 249);
}
.mce-item-table, .mce-item-table td, .mce-item-table th, .mce-item-table caption {
border: 1px solid #ddd;
border-collapse: collapse;
padding: 6px 13px;
}
blockquote {
border-left-width:10px;
background-color:rgba(128,128,128,0.05);
border-top-right-radius:5px;
border-bottom-right-radius:5px;
padding:15px 20px;
border-left:5px solid rgba(128,128,128,0.075);
}
blockquote p {
margin-bottom:1.1em;
font-size:1em;
line-height:1.45
}
blockquote ul:last-child,blockquote ol:last-child {
margin-bottom:0
}
pre {
padding: 18px;
background-color: #f7f7f9;
border: 1px solid #e1e1e8;
border-radius: 3px;
display: block;
}
code {
padding: 2px 4px;
font-size: 90%;
color: #c7254e;
white-space: nowrap;
background-color: #f9f2f4;
border-radius: 4px;
}
.footnote {
vertical-align: top;
position: relative;
top: -0.5em;
font-size: .8em;
}
hr {
margin:2em 0
}
img {
max-width:100%
}
pre {
word-break:break-word
}
p,pre,pre.prettyprint,blockquote {
margin:0 0 1.1em
}
hr {
margin:2em 0
}
img {
max-width:100%
}
.sequence-diagram,.flow-chart {
text-align:center;
margin-bottom:1.1em
}
.sequence-diagram text,.flow-chart text {
font-size:15px !important;
font-family:"Source Sans Pro",sans-serif !important
}
.sequence-diagram [fill="#ffffff"],.flow-chart [fill="#ffffff"] {
fill:#f6f6f6
}
.sequence-diagram [stroke="#000000"],.flow-chart [stroke="#000000"] {
stroke:#3f3f3f
}
.sequence-diagram text[stroke="#000000"],.flow-chart text[stroke="#000000"] {
stroke:none
}
.sequence-diagram [fill="#000"],.flow-chart [fill="#000"],.sequence-diagram [fill="#000000"],.flow-chart [fill="#000000"],.sequence-diagram [fill="black"],.flow-chart [fill="black"] {
fill:#3f3f3f
}
ul,ol {
margin-bottom:1.1em
}
ul ul,ol ul,ul ol,ol ol {
margin-bottom:1.1em
}
kbd {
padding:.1em .6em;
border:1px solid rgba(63,63,63,0.25);
-webkit-box-shadow:0 1px 0 rgba(63,63,63,0.25);
box-shadow:0 1px 0 rgba(63,63,63,0.25);
font-size:.7em;
font-family:sans-serif;
background-color:#fff;
color:#333;
border-radius:3px;
display:inline-block;
margin:0 .1em;
white-space:nowrap
}
.toc ul {
list-style-type:none;
margin-bottom:15px
}
</style>
<!-- 该css供自定义样式 -->
<link href="../leanote-html.css" rel="stylesheet">
</head>
<body>
<div class="note-container">
<h1 class="title" id="leanote-title">mqaction-v2.sh</h1>
<div class="content-html" id="leanote-content"><pre id="leanote_ace_1523266647677_0" class="brush:sh ace-tomorrow">#!/bin/bash
# Edit by ZeroC
# 20180407
. /etc/init.d/functions
name=$1
action=$2
basedir=/data/htdocs/v/$name
startmq(){
cd $basedir
statusmq
if [ $? -eq 0 ];then
#echo -e "\033[33;1m$name MQ监听启动\033[0m"
nohup /usr/local/php70/bin/php mqconsumer.php &gt; /dev/null 2&gt;&amp;1 &amp;
echo -e "\033[33;1mInfo\033[0m:\033[32;1m$name MQ监听启动完成\033[0m"
elif [ $? -eq 1 ];then
echo -e "\033[33;1mWarning\033[0m:\033[33;1m$name MQ监听已启动\033[0m"
fi
}
stopmq(){
cd $basedir
statusmq
if [ $? -eq 1 ];then
#echo -e "\033[33;1m$name MQ监听停止\033[0m"
/usr/local/php70/bin/php mqconsumer.php stop &gt; /dev/null
ps aux | grep php-ps| grep -v grep | awk '{print $2}'| xargs kill -9 &gt; /dev/null 2&gt;&amp;1
echo -e "\033[33;1mInfo\033[0m:\033[32;1m$name MQ监听停止完成\033[0m"
elif [ $? -eq 0 ];then
echo -e "\033[33;1mWarning\033[0m:\033[33;1m$name MQ监听已停止\033[0m"
fi
}
restartmq(){
stopmq
startmq
}
statusmq(){
cd $basedir
result1=`/usr/local/php70/bin/php mqconsumer.php status`
result2=`netstat -anltp | grep php-ps| grep -v grep`
if [ $result1 -eq 0 ] &amp;&amp; [ x == x"$result2" ];then
echo -e "\033[33;1mStatus\033[0m:\033[32;1m$name MQ监听已停止\033[0m"
return 0
elif [ $result1 -eq 1 ] &amp;&amp; [ x != x"$result2" ];then
echo -e "\033[33;1mStatus\033[0m:\033[32;1m$name MQ监听在运行\033[0m"
return 1
fi
}
case $action in
start)
startmq
;;
stop)
stopmq
;;
status)
statusmq
;;
restart)
restartmq
;;
*)
echo -e "\033[33;1mi\t参数异常!\nUsage: bash $0 $name (start|stop|restart|status)\033[0m"
;;
esac
</pre><p><br data-mce-bogus="1"></p></div>
</div>
<!-- 该js供其它处理 -->
<script src="../leanote-html.js"></script>
</body>
</html>