mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-10 02:29:26 +08:00
Compare commits
351
Commits
ee9e154fec
...
dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
36ca82c1b4 | ||
|
|
acd46f4724 | ||
|
|
370ff99134 | ||
|
|
aa317ee2f5 | ||
|
|
44600b5657 | ||
|
|
ea45316a32 | ||
|
|
6cd13022f1 | ||
|
|
91ff2f7550 | ||
|
|
483b5b090d | ||
|
|
6087931c58 | ||
|
|
9014fd8911 | ||
|
|
76f7f51d80 | ||
|
|
0c4902e01e | ||
|
|
175fb089cd | ||
|
|
7b8a4a38b3 | ||
|
|
ebf920ed12 | ||
|
|
bb8591f5e5 | ||
|
|
b8573e1f1f | ||
|
|
dacc1e5ad8 | ||
|
|
8cc64e32dd | ||
|
|
1d294cc3b1 | ||
|
|
f9da2e4391 | ||
|
|
3b78079cd2 | ||
|
|
07a0a1be48 | ||
|
|
837f95e571 | ||
|
|
909d818caa | ||
|
|
355ceebbd7 | ||
|
|
6ae1370709 | ||
|
|
93b5d8b8b4 | ||
|
|
be461a15a9 | ||
|
|
c239f35382 | ||
|
|
49d57af719 | ||
|
|
19fc0fdc51 | ||
|
|
c1fd4fa24c | ||
|
|
7239b22759 | ||
|
|
f5fa94ae95 | ||
|
|
b679ea035d | ||
|
|
49bbca8faa | ||
|
|
8b86cd5e63 | ||
|
|
698e3ffd81 | ||
|
|
c2284dcee5 | ||
|
|
b68c9edc3e | ||
|
|
650365997a | ||
|
|
3279404595 | ||
|
|
d32a94dccf | ||
|
|
80d846f247 | ||
|
|
eadcbe336d | ||
|
|
474d0f075f | ||
|
|
2d6a41e19f | ||
|
|
1f24944417 | ||
|
|
4ab3409e54 | ||
|
|
c3ad146303 | ||
|
|
745cd304fb | ||
|
|
e6efefd1fd | ||
|
|
1350404c58 | ||
|
|
9cdd2274fa | ||
|
|
cc204ad721 | ||
|
|
8eb1614b31 | ||
|
|
9c2e9627ec | ||
|
|
87123c526a | ||
|
|
7c3ebc6e35 | ||
|
|
6c5bf63424 | ||
|
|
13fd47e7d4 | ||
|
|
fc1321584a | ||
|
|
bab3ae16d3 | ||
|
|
ab8498e519 | ||
|
|
0e480c7ad8 | ||
|
|
7ed8558ff0 | ||
|
|
4ed2f0caa9 | ||
|
|
f275eabe1b | ||
|
|
fe13ab1e5f | ||
|
|
6ed045cf94 | ||
|
|
ef333ff142 | ||
|
|
dac2f5240f | ||
|
|
cebfc2fc91 | ||
|
|
1da865c1b2 | ||
|
|
2abdaaa7ce | ||
|
|
c62142cf6b | ||
|
|
7c1820b6cd | ||
|
|
a24af95d24 | ||
|
|
1326c282c8 | ||
|
|
b7e84749f1 | ||
|
|
8a65158540 | ||
|
|
a576c521a2 | ||
|
|
736a387a71 | ||
|
|
090205c372 | ||
|
|
fda0bddc8f | ||
|
|
292b18468d | ||
|
|
47aab245fc | ||
|
|
39bd601825 | ||
|
|
b744adeb13 | ||
|
|
7b70f9fc99 | ||
|
|
0723f751b3 | ||
|
|
1fd8617a12 | ||
|
|
2fec8fcef4 | ||
|
|
51a48afa71 | ||
|
|
76919faca7 | ||
|
|
9bcbeaf1a5 | ||
|
|
d0de121721 | ||
|
|
957e2db3d0 | ||
|
|
fb0be5549d | ||
|
|
8a9132d557 | ||
|
|
04d10435c2 | ||
|
|
92543e10fa | ||
|
|
cd427dcbf3 | ||
|
|
ddb5e0285b | ||
|
|
75610a4559 | ||
|
|
b8f7a45f61 | ||
|
|
37d5ce719e | ||
|
|
ef9053aa7e | ||
|
|
018fcb7afb | ||
|
|
5cc9a67152 | ||
|
|
54895f1d0a | ||
|
|
91dfecf882 | ||
|
|
2f09e227d1 | ||
|
|
5d0463836e | ||
|
|
fb6499cb35 | ||
|
|
0bbfb58e67 | ||
|
|
fcd780a7d3 | ||
|
|
4f4d1e7580 | ||
|
|
6e2a8e0a12 | ||
|
|
817b4b36c7 | ||
|
|
0ba89cbb9e | ||
|
|
4e3e7864be | ||
|
|
6f51eaa298 | ||
|
|
39bd87e868 | ||
|
|
18443aab60 | ||
|
|
b88ea7aa3c | ||
|
|
6a6f6e6062 | ||
|
|
5839dbcd6b | ||
|
|
b46f45569e | ||
|
|
5cdc5af8cd | ||
|
|
4f38a9f3ff | ||
|
|
9c83695187 | ||
|
|
f9be534101 | ||
|
|
58ab48ac15 | ||
|
|
f34e93192d | ||
|
|
31106f2b13 | ||
|
|
468cc54cf5 | ||
|
|
728a38c55c | ||
|
|
b2b23b0e3b | ||
|
|
167dd11548 | ||
|
|
03fdbf2604 | ||
|
|
edbdec8370 | ||
|
|
8f1c9f9471 | ||
|
|
d35d16943d | ||
|
|
3ac4270dee | ||
|
|
90777e08ff | ||
|
|
b47d1262ac | ||
|
|
e28081a7c5 | ||
|
|
5f7d6c1488 | ||
|
|
59385e11be | ||
|
|
a668d88791 | ||
|
|
e62bd7c5a6 | ||
|
|
1ad3d2f187 | ||
|
|
bf06af14ed | ||
|
|
805c96f260 | ||
|
|
8ccba2f6d5 | ||
|
|
2e9f01d3ee | ||
|
|
d1dcdd4f25 | ||
|
|
60958d1403 | ||
|
|
5530b14f36 | ||
|
|
64c9942ee1 | ||
|
|
bc1437dac4 | ||
|
|
1d9576e838 | ||
|
|
8b275a5df4 | ||
|
|
40d9334dcf | ||
|
|
98c0242819 | ||
|
|
a2fb03f9b8 | ||
|
|
98815ac5c3 | ||
|
|
073dd20c96 | ||
|
|
23af9085a9 | ||
|
|
bcaec6b6ee | ||
|
|
4063bea922 | ||
|
|
9f864b3407 | ||
|
|
01ac598e39 | ||
|
|
77a0d3af36 | ||
|
|
8d34bbea47 | ||
|
|
be18e98001 | ||
|
|
754e0f98f9 | ||
|
|
07f893b6a1 | ||
|
|
c1497ec44e | ||
|
|
55d4784fe2 | ||
|
|
f26e8bc520 | ||
|
|
7b5f1a4253 | ||
|
|
1058fb7e1f | ||
|
|
0f1b95cdfc | ||
|
|
8ea16fcd85 | ||
|
|
b4b9496980 | ||
|
|
8dfd26361f | ||
|
|
cb5bd32b86 | ||
|
|
2584330d40 | ||
|
|
ebe6333ac9 | ||
|
|
534892280e | ||
|
|
df05cf69cf | ||
|
|
2f782cf6a2 | ||
|
|
6f483c17e6 | ||
|
|
e64610a2dc | ||
|
|
7673a16779 | ||
|
|
d73fe4b29c | ||
|
|
2c61be084b | ||
|
|
fe5f8d1997 | ||
|
|
2653291ded | ||
|
|
417f91a2e8 | ||
|
|
08625e85bb | ||
|
|
c554c19a12 | ||
|
|
d7d08f2f12 | ||
|
|
bafe45a2f9 | ||
|
|
a11d24723d | ||
|
|
3b858476f1 | ||
|
|
5560b68ac1 | ||
|
|
8bfd381363 | ||
|
|
c6cfe2a22c | ||
|
|
4ed274dedc | ||
|
|
283c815de7 | ||
|
|
c72c1bc889 | ||
|
|
6e61a535ca | ||
|
|
c1f69ea1c7 | ||
|
|
984599c56f | ||
|
|
038bb31ec3 | ||
|
|
1ac541d16e | ||
|
|
ecaa0e99c5 | ||
|
|
666ebeef0d | ||
|
|
b39a936fa4 | ||
|
|
d434dce568 | ||
|
|
6acb390133 | ||
|
|
3c6f3c50c4 | ||
|
|
c52e707421 | ||
|
|
5fb998c221 | ||
|
|
a0989ea833 | ||
|
|
5e565c06a0 | ||
|
|
69b96aa5fa | ||
|
|
bce9de1494 | ||
|
|
3de7928be7 | ||
|
|
41630ef01a | ||
|
|
bf29cb1a4d | ||
|
|
8f79a4ab86 | ||
|
|
0ad933c5ad | ||
|
|
5ed9470d83 | ||
|
|
cac468f454 | ||
|
|
f0f9dcf4de | ||
|
|
3e0e84a4f6 | ||
|
|
ef8080b420 | ||
|
|
b5fab1fb10 | ||
|
|
c3f019d4ff | ||
|
|
701f172276 | ||
|
|
9e8c736cb4 | ||
|
|
c8589d750c | ||
|
|
5bb20a01de | ||
|
|
6e4bf9da3e | ||
|
|
c21ddb5c63 | ||
|
|
431295cec9 | ||
|
|
180cb84b2c | ||
|
|
66b5f322d9 | ||
|
|
f00dc248bd | ||
|
|
dbba5db9f7 | ||
|
|
3a8b799df6 | ||
|
|
0b99a4ae74 | ||
|
|
99b77d347a | ||
|
|
8235a88ecc | ||
|
|
564ba30f91 | ||
|
|
aa8535d513 | ||
|
|
a02ef2575b | ||
|
|
a0be16c0fa | ||
|
|
548d87e339 | ||
|
|
c704aa0817 | ||
|
|
c6a060fde5 | ||
|
|
762e88cc44 | ||
|
|
b7f671d1d5 | ||
|
|
48706d01f9 | ||
|
|
fb53354956 | ||
|
|
5995147054 | ||
|
|
fed9f458d1 | ||
|
|
7987564401 | ||
|
|
90ae21fb8b | ||
|
|
56a78d174d | ||
|
|
37da947b90 | ||
|
|
f23e272027 | ||
|
|
10afc0a2d5 | ||
|
|
f59c8ea533 | ||
|
|
4153ea7431 | ||
|
|
2c73577798 | ||
|
|
0b5c53ef7e | ||
|
|
0fca0d54f8 | ||
|
|
3da0c5b2b6 | ||
|
|
d8519bc1c3 | ||
|
|
33a4a799c5 | ||
|
|
358a021ba6 | ||
|
|
6dba9c25b6 | ||
|
|
1f724c802b | ||
|
|
67e3dd0035 | ||
|
|
de657829fd | ||
|
|
a2c27134a8 | ||
|
|
66c60ec10e | ||
|
|
867b39d8e1 | ||
|
|
1c8997d44a | ||
|
|
88b5112e30 | ||
|
|
3874b6a25a | ||
|
|
8ba6587c57 | ||
|
|
3ebe36f785 | ||
|
|
34ed0b96d3 | ||
|
|
ab353d2268 | ||
|
|
fd6f013480 | ||
|
|
4d0b7bc127 | ||
|
|
ce917b227f | ||
|
|
dec1bb04e8 | ||
|
|
a1093c17bc | ||
|
|
8110fbf701 | ||
|
|
cf502ebf05 | ||
|
|
7c7837b967 | ||
|
|
3bfc1cacb0 | ||
|
|
cd2ea26608 | ||
|
|
dcf8159d1c | ||
|
|
1bdab80b5d | ||
|
|
241c4dc600 | ||
|
|
18e93d2b24 | ||
|
|
084cf6b761 | ||
|
|
47ddf5f4e6 | ||
|
|
325321f5d4 | ||
|
|
ecbeca3d35 | ||
|
|
862b434c72 | ||
|
|
6376ed3b7b | ||
|
|
42e40d1718 | ||
|
|
1c1cc12058 | ||
|
|
e648b88a74 | ||
|
|
6fea46f7c8 | ||
|
|
a06e5a6e55 | ||
|
|
85bf429a08 | ||
|
|
dd6ba45cdd | ||
|
|
ab967efa64 | ||
|
|
369505e1a0 | ||
|
|
86d858a0fb | ||
|
|
d1f5158276 | ||
|
|
db83b0f78c | ||
|
|
24fcc5a0c6 | ||
|
|
9cb3d474aa | ||
|
|
0adfebfad6 | ||
|
|
66c4225aa3 | ||
|
|
6ddef9ffda | ||
|
|
27a1b22e6f | ||
|
|
f9c18cb225 | ||
|
|
b97733328a | ||
|
|
2fe17aefd9 | ||
|
|
acddca54cd | ||
|
|
7d80fb31ce | ||
|
|
8ac1d78053 | ||
|
|
468d6d7752 | ||
|
|
f49d789411 | ||
|
|
1f56115fbb | ||
|
|
20d277102e | ||
|
|
47b4036f09 |
@@ -108,7 +108,7 @@ docker run -itd --name mw-server --privileged=true -p 7200:7200 -p 80:80 -p 443:
|
||||
```
|
||||
|
||||
|
||||
### 版本更新 0.18.5
|
||||
### 版本更新 0.18.6
|
||||
|
||||
- 常规优化。
|
||||
|
||||
|
||||
@@ -80,6 +80,7 @@ def runPanelTask():
|
||||
# 站点过期检查
|
||||
siteEdateCheck()
|
||||
|
||||
# echo "True" > /www/server/mdserver-web/logs/panel_task.lock
|
||||
lock_file = mw.getTriggerTaskLockFile()
|
||||
try:
|
||||
if os.path.exists(lock_file):
|
||||
|
||||
@@ -606,7 +606,7 @@ def runHookDstDomain(row):
|
||||
|
||||
if mw.isAppleSystem():
|
||||
user = getRunUser()
|
||||
cmd += "source /Users/"+user+"/.zshrc\n"
|
||||
cmd += ". /Users/"+user+"/.zshrc\n"
|
||||
|
||||
cmd_data = getDnsapiData(row['dnsapi_id'])
|
||||
# print(cmd_data)
|
||||
|
||||
@@ -13,7 +13,7 @@ VERSION=$2
|
||||
# acme.sh --uninstall
|
||||
|
||||
|
||||
# source /Users/xxx/.zshrc
|
||||
# . /Users/xxx/.zshrc
|
||||
|
||||
# https://github.com/acmesh-official/acme.sh/wiki/dnsapi
|
||||
# https://docs.dnspod.com/api-legacy/domains.html#get-the-domain-list
|
||||
@@ -24,7 +24,7 @@ VERSION=$2
|
||||
|
||||
|
||||
if [ -f ${rootPath}/bin/activate ];then
|
||||
source ${rootPath}/bin/activate
|
||||
. ${rootPath}/bin/activate
|
||||
fi
|
||||
|
||||
# pip install cloudflare
|
||||
@@ -47,7 +47,7 @@ Uninstall_App()
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_App
|
||||
else
|
||||
Uninstall_App
|
||||
|
||||
@@ -16,16 +16,16 @@ sysArch=`arch`
|
||||
sysName=`uname`
|
||||
|
||||
ALIST_ARCH_NAME=amd64
|
||||
if [ "$sysArch" == "arm64" ];then
|
||||
if [ "$sysArch" = "arm64" ];then
|
||||
ALIST_ARCH_NAME=arm64
|
||||
elif [ "$sysArch" == "x86_64" ]; then
|
||||
elif [ "$sysArch" = "x86_64" ]; then
|
||||
ALIST_ARCH_NAME=amd64
|
||||
elif [ "$sysArch" == "aarch64" ]; then
|
||||
elif [ "$sysArch" = "aarch64" ]; then
|
||||
ALIST_ARCH_NAME=arm64
|
||||
fi
|
||||
|
||||
ALIST_NAME=linux
|
||||
if [ "$sysName" == "Darwin" ];then
|
||||
if [ "$sysName" = "Darwin" ];then
|
||||
ALIST_NAME=darwin
|
||||
fi
|
||||
|
||||
@@ -86,7 +86,7 @@ Uninstall_App()
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_App
|
||||
else
|
||||
Uninstall_App
|
||||
|
||||
@@ -27,7 +27,7 @@ else
|
||||
fi
|
||||
|
||||
NGINX_IDS=`ps -ef|grep nginx | grep -v grep| awk '{print $2}'`
|
||||
if [ "$NGINX_IDS" == "" ];then
|
||||
if [ "$NGINX_IDS" = "" ];then
|
||||
ps -ef|grep nginx| grep -v grep| awk '{print $2}' | xargs kill -9
|
||||
systemctl start "$service_name"
|
||||
echo "OpenResty未运行,正在启动服务..."
|
||||
|
||||
@@ -38,7 +38,7 @@ else
|
||||
useradd -g www -s /bin/bash www
|
||||
fi
|
||||
|
||||
if [ "${action}" == "upgrade" ];then
|
||||
if [ "${action}" = "upgrade" ];then
|
||||
sh -x $curPath/versions/$2/install.sh $1
|
||||
|
||||
echo "${VERSION}" > $serverPath/apache/version.pl
|
||||
@@ -53,12 +53,12 @@ if [ "${action}" == "upgrade" ];then
|
||||
fi
|
||||
|
||||
|
||||
if [ "${2}" == "" ];then
|
||||
if [ "${2}" = "" ];then
|
||||
echo '缺少安装脚本版本...'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "${action}" == "uninstall" ];then
|
||||
if [ "${action}" = "uninstall" ];then
|
||||
if [ -f /usr/lib/systemd/system/httpd.service ] || [ -f /lib/systemd/system/httpd.service ];then
|
||||
systemctl stop httpd
|
||||
rm -rf /usr/systemd/system/httpd.service
|
||||
@@ -75,7 +75,7 @@ fi
|
||||
|
||||
sh -x $curPath/versions/$2/install.sh $1
|
||||
|
||||
if [ "${action}" == "install" ] && [ -d $serverPath/apache ];then
|
||||
if [ "${action}" = "install" ] && [ -d $serverPath/apache ];then
|
||||
echo "${VERSION}" > $serverPath/apache/version.pl
|
||||
|
||||
mkdir -p $serverPath/web_conf/php/conf
|
||||
|
||||
@@ -14,12 +14,12 @@ sysName=`uname`
|
||||
action=$1
|
||||
type=$2
|
||||
|
||||
VERSION=2.4.66
|
||||
VERSION=2.4.68
|
||||
apacheDir=${serverPath}/source/apache
|
||||
|
||||
Install_App()
|
||||
{
|
||||
if [ "${action}" == "install" ];then
|
||||
if [ "${action}" = "install" ];then
|
||||
if [ -d $serverPath/apache ];then
|
||||
exit 0
|
||||
fi
|
||||
@@ -71,7 +71,7 @@ Install_App()
|
||||
cd ${apacheDir} && tar -jxf apr-${APR_VERSION}.tar.bz2
|
||||
cd ${apacheDir}/apr-${APR_VERSION} && ./configure --prefix=${serverPath}/apache/apr
|
||||
make -j${cpuCore} && make install
|
||||
if [ "$?" == "0" ];then
|
||||
if [ "$?" = "0" ];then
|
||||
# 检查 APR 配置文件
|
||||
APR_CONFIG=$(find ${serverPath}/apache/apr -name "apr-*config" | head -1)
|
||||
if [ -z "$APR_CONFIG" ];then
|
||||
@@ -90,7 +90,7 @@ Install_App()
|
||||
cd ${apacheDir} && tar -jxf apr-util-${APR_UTIL_VERSION}.tar.bz2
|
||||
cd ${apacheDir}/apr-util-${APR_UTIL_VERSION} && ./configure --prefix=${serverPath}/apache/apr-util --with-apr=${serverPath}/apache/apr
|
||||
make -j${cpuCore} && make install
|
||||
if [ "$?" == "0" ];then
|
||||
if [ "$?" = "0" ];then
|
||||
# 检查 APR-util 配置文件
|
||||
APU_CONFIG=$(find ${serverPath}/apache/apr-util -name "apu-*config" | head -1)
|
||||
if [ -z "$APU_CONFIG" ];then
|
||||
@@ -163,9 +163,9 @@ Uninstall_App()
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == "install" ];then
|
||||
if [ "${1}" = "install" ];then
|
||||
Install_App
|
||||
elif [ "${1}" == "upgrade" ];then
|
||||
elif [ "${1}" = "upgrade" ];then
|
||||
Install_App
|
||||
else
|
||||
Uninstall_App
|
||||
|
||||
@@ -24,7 +24,7 @@ Uninstall_App()
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_App $2
|
||||
else
|
||||
Uninstall_App $2
|
||||
|
||||
@@ -27,7 +27,7 @@ else
|
||||
fi
|
||||
|
||||
NGINX_IDS=`ps -ef|grep caddy | grep -v grep| awk '{print $2}'`
|
||||
if [ "$NGINX_IDS" == "" ];then
|
||||
if [ "$NGINX_IDS" = "" ];then
|
||||
ps -ef|grep caddy| grep -v grep| awk '{print $2}' | xargs kill -9
|
||||
systemctl start "$service_name"
|
||||
echo "caddy未运行,正在启动服务..."
|
||||
|
||||
@@ -109,7 +109,7 @@ def initDreplace():
|
||||
caddy_file = getConf()
|
||||
if not os.path.exists(caddy_file):
|
||||
caddy_file_tpl = getConfTpl()
|
||||
content = mw.readFile(systemServiceTpl)
|
||||
content = mw.readFile(caddy_file_tpl)
|
||||
content = content.replace('{$SERVER_PATH}', service_path)
|
||||
mw.writeFile(caddy_file, content)
|
||||
|
||||
|
||||
@@ -20,9 +20,9 @@ After=network.target network-online.target
|
||||
Requires=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=notify
|
||||
User=caddy
|
||||
Group=caddy
|
||||
Type=simple
|
||||
User=www
|
||||
Group=www
|
||||
ExecStart={$SERVER_PATH}/caddy/bin/caddy run --environ --config {$SERVER_PATH}/caddy/Caddyfile
|
||||
ExecReload={$SERVER_PATH}/caddy/bin/caddy reload --config {$SERVER_PATH}/caddy/Caddyfile --force
|
||||
TimeoutStopSec=5s
|
||||
|
||||
@@ -3,7 +3,7 @@ PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin:/opt/hom
|
||||
export PATH
|
||||
|
||||
# cd /Users/midoks/Desktop/mwdev/server/mdserver-web/plugins/caddy && bash install.sh install 1.21.4
|
||||
# cd /www/server/mdserver-web/plugins/caddy && bash install.sh install 1.21.4
|
||||
# cd /www/server/mdserver-web/plugins/caddy && bash install.sh install 2.11
|
||||
# cd /www/server/mdserver-web/plugins/caddy && bash install.sh install 1.29.2
|
||||
# cd /www/server/mdserver-web/plugins/caddy && bash install.sh upgrade 1.29.2
|
||||
|
||||
@@ -33,7 +33,7 @@ else
|
||||
useradd -g www -s /bin/bash www
|
||||
fi
|
||||
|
||||
if [ "${action}" == "upgrade" ];then
|
||||
if [ "${action}" = "upgrade" ];then
|
||||
sh -x $curPath/versions/$2/install.sh $1
|
||||
|
||||
echo "${VERSION}" > $serverPath/caddy/version.pl
|
||||
@@ -45,12 +45,12 @@ if [ "${action}" == "upgrade" ];then
|
||||
fi
|
||||
|
||||
|
||||
if [ "${2}" == "" ];then
|
||||
if [ "${2}" = "" ];then
|
||||
echo '缺少安装脚本版本...'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "${action}" == "uninstall" ];then
|
||||
if [ "${action}" = "uninstall" ];then
|
||||
if [ -f /usr/lib/systemd/system/caddy.service ] || [ -f /lib/systemd/system/caddy.service ];then
|
||||
systemctl stop caddy
|
||||
rm -rf /usr/systemd/system/caddy.service
|
||||
@@ -67,7 +67,7 @@ fi
|
||||
|
||||
sh -x $curPath/versions/$2/install.sh $1
|
||||
|
||||
if [ "${action}" == "install" ] && [ -d $serverPath/caddy ];then
|
||||
if [ "${action}" = "install" ] && [ -d $serverPath/caddy ];then
|
||||
echo "${VERSION}" > $serverPath/caddy/version.pl
|
||||
|
||||
#初始化
|
||||
|
||||
@@ -30,6 +30,7 @@ case $(uname -m) in
|
||||
x86_64) ARCH_NAME="amd64" ;;
|
||||
arm) ARCH_NAME="arm64" ;;
|
||||
arm64) ARCH_NAME="arm64" ;;
|
||||
aarch64) ARCH_NAME="arm64" ;;
|
||||
esac
|
||||
|
||||
VERSION=2.11.2
|
||||
@@ -38,7 +39,7 @@ caddyDir=${serverPath}/source/caddy
|
||||
|
||||
Install_App()
|
||||
{
|
||||
if [ "${action}" == "install" ];then
|
||||
if [ "${action}" = "install" ];then
|
||||
if [ -d $serverPath/caddy ];then
|
||||
exit 0
|
||||
fi
|
||||
@@ -59,7 +60,7 @@ Install_App()
|
||||
|
||||
mkdir -p cd $serverPath/source/caddy/caddy
|
||||
cd $serverPath/source/caddy/caddy && tar -zxvf ${caddyDir}/$FILE_NAME
|
||||
if [ "$OSNAME" == "mac" ];then
|
||||
if [ "$OSNAME" = "mac" ];then
|
||||
xattr -cr caddy
|
||||
fi
|
||||
|
||||
@@ -78,9 +79,9 @@ Uninstall_App()
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == "install" ];then
|
||||
if [ "${1}" = "install" ];then
|
||||
Install_App
|
||||
elif [ "${1}" == "upgrade" ];then
|
||||
elif [ "${1}" = "upgrade" ];then
|
||||
Install_App
|
||||
else
|
||||
Uninstall_App
|
||||
|
||||
@@ -13,7 +13,7 @@ serverPath=$(dirname "$rootPath")
|
||||
VERSION=$2
|
||||
|
||||
if [ -f ${rootPath}/bin/activate ];then
|
||||
source ${rootPath}/bin/activate
|
||||
. ${rootPath}/bin/activate
|
||||
fi
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ Uninstall_app()
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_app
|
||||
else
|
||||
Uninstall_app
|
||||
|
||||
@@ -16,16 +16,16 @@ sysArch=`arch`
|
||||
sysName=`uname`
|
||||
|
||||
ALIST_ARCH_NAME=amd64
|
||||
if [ "$sysArch" == "arm64" ];then
|
||||
if [ "$sysArch" = "arm64" ];then
|
||||
ALIST_ARCH_NAME=arm64
|
||||
elif [ "$sysArch" == "x86_64" ]; then
|
||||
elif [ "$sysArch" = "x86_64" ]; then
|
||||
ALIST_ARCH_NAME=amd64
|
||||
elif [ "$sysArch" == "aarch64" ]; then
|
||||
elif [ "$sysArch" = "aarch64" ]; then
|
||||
ALIST_ARCH_NAME=aarch64
|
||||
fi
|
||||
|
||||
ALIST_NAME=linux
|
||||
if [ "$sysName" == "Darwin" ];then
|
||||
if [ "$sysName" = "Darwin" ];then
|
||||
ALIST_NAME=darwin
|
||||
fi
|
||||
|
||||
@@ -83,7 +83,7 @@ Uninstall_App()
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_App
|
||||
else
|
||||
Uninstall_App
|
||||
|
||||
@@ -15,7 +15,7 @@ from pprint import pprint
|
||||
sys.path.append(os.getcwd() + "/class/core")
|
||||
import mw
|
||||
|
||||
# cd /www/server/mdserver-web && source bin/activate
|
||||
# cd /www/server/mdserver-web && . bin/activate
|
||||
# python3 plugins/cryptocurrency_trade/ccxt/public_data/data.py run
|
||||
# python3 plugins/cryptocurrency_trade/ccxt/public_data/data.py long
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ curPath=`pwd`
|
||||
# bash plugins/cryptocurrency_trade/ccxt/public_data/data.sh
|
||||
|
||||
if [ -f ${curPath}/bin/activate ];then
|
||||
source ${curPath}/bin/activate
|
||||
. ${curPath}/bin/activate
|
||||
fi
|
||||
|
||||
python3 plugins/cryptocurrency_trade/ccxt/public_data/data.py long
|
||||
|
||||
@@ -11,7 +11,7 @@ from decimal import Decimal
|
||||
sys.path.append(os.getcwd() + "/plugins/cryptocurrency_trade/strategy")
|
||||
import common
|
||||
|
||||
# cd /www/server/mdserver-web && source bin/activate
|
||||
# cd /www/server/mdserver-web && . bin/activate
|
||||
# python3 plugins/cryptocurrency_trade/ccxt/strategy/func_test.py run
|
||||
|
||||
# common.notifyMsg("任务开始")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# cd /www/server/mdserver-web && source bin/activate
|
||||
# cd /www/server/mdserver-web && . bin/activate
|
||||
# python3 plugins/cryptocurrency_trade/ccxt/strategy/gate_100.py run
|
||||
# python3 plugins/cryptocurrency_trade/ccxt/strategy/gate_100.py long
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ from pprint import pprint
|
||||
sys.path.append(os.getcwd() + "/plugins/cryptocurrency_trade/strategy")
|
||||
import common
|
||||
|
||||
# cd /www/server/mdserver-web && source bin/activate
|
||||
# cd /www/server/mdserver-web && . bin/activate
|
||||
# python3 plugins/cryptocurrency_trade/ccxt/strategy/hammer_robot.py run
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# cd /www/server/mdserver-web && source bin/activate
|
||||
# cd /www/server/mdserver-web && . bin/activate
|
||||
# python3 plugins/cryptocurrency_trade/ccxt/strategy/macd_kdj.py run
|
||||
# python3 plugins/cryptocurrency_trade/ccxt/strategy/macd_kdj.py long
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# cd /www/server/mdserver-web && source bin/activate
|
||||
# cd /www/server/mdserver-web && . bin/activate
|
||||
# python3 plugins/cryptocurrency_trade/ccxt/strategy/momentun_trade.py run
|
||||
# python3 plugins/cryptocurrency_trade/ccxt/strategy/momentun_trade.py long
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# cd /www/server/mdserver-web && source bin/activate
|
||||
# cd /www/server/mdserver-web && . bin/activate
|
||||
# python3 plugins/cryptocurrency_trade/ccxt/strategy/notify_demo.py run
|
||||
# python3 plugins/cryptocurrency_trade/ccxt/strategy/notify_demo.py long
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# cd /www/server/mdserver-web && source bin/activate
|
||||
# cd /www/server/mdserver-web && . bin/activate
|
||||
|
||||
# python3 plugins/cryptocurrency_trade/ccxt/strategy/on_g_test.py t_buy_open
|
||||
# python3 plugins/cryptocurrency_trade/ccxt/strategy/on_g_test.py t_buy_close
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# cd /www/server/mdserver-web && source bin/activate
|
||||
# cd /www/server/mdserver-web && . bin/activate
|
||||
# python3 plugins/cryptocurrency_trade/ccxt/strategy/online_macd_trade.py run
|
||||
# python3 plugins/cryptocurrency_trade/ccxt/strategy/online_macd_trade.py long
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# cd /www/server/mdserver-web && source bin/activate
|
||||
# cd /www/server/mdserver-web && . bin/activate
|
||||
|
||||
# python3 plugins/cryptocurrency_trade/ccxt/strategy/online_test.py t_buy_open
|
||||
# python3 plugins/cryptocurrency_trade/ccxt/strategy/online_test.py t_buy_close
|
||||
|
||||
@@ -11,7 +11,7 @@ from pprint import pprint
|
||||
sys.path.append(os.getcwd() + "/plugins/cryptocurrency_trade/strategy")
|
||||
import common
|
||||
|
||||
# cd /www/server/mdserver-web && source bin/activate
|
||||
# cd /www/server/mdserver-web && . bin/activate
|
||||
# python3 plugins/cryptocurrency_trade/ccxt/strategy/rsi_robot.py run
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# cd /www/server/mdserver-web && source bin/activate
|
||||
# cd /www/server/mdserver-web && . bin/activate
|
||||
# python3 plugins/cryptocurrency_trade/ccxt/strategy/vega_trade.py run
|
||||
# python3 plugins/cryptocurrency_trade/ccxt/strategy/vega_trade.py long
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ pip install git+https://github.com/catalyst-team/catalyst@master --upgrade
|
||||
cd /www/server/mdserver-web && python3 plugins/cryptocurrency_trade/ccxt/test/p1.py
|
||||
|
||||
|
||||
cd /Users/midoks/Desktop/mwdev/server/mdserver-web && source bin/activate
|
||||
cd /Users/midoks/Desktop/mwdev/server/mdserver-web && . bin/activate
|
||||
|
||||
python3 plugins/cryptocurrency_trade/ccxt/test/p1.py
|
||||
'''
|
||||
|
||||
@@ -5,7 +5,7 @@ pip install git+https://github.com/catalyst-team/catalyst@master --upgrade
|
||||
cd /www/server/mdserver-web && python3 plugins/cryptocurrency_trade/ccxt/test/p1.py
|
||||
|
||||
|
||||
cd /Users/midoks/Desktop/mwdev/server/mdserver-web && source bin/activate
|
||||
cd /Users/midoks/Desktop/mwdev/server/mdserver-web && . bin/activate
|
||||
|
||||
python3 plugins/cryptocurrency_trade/ccxt/test/p1.py
|
||||
'''
|
||||
|
||||
@@ -9,10 +9,10 @@ from catalyst import run_algorithm
|
||||
from catalyst.api import order, record, symbol
|
||||
|
||||
'''
|
||||
cd /Users/midoks/Desktop/mwdev/server/mdserver-web && source bin/activate
|
||||
cd /Users/midoks/Desktop/mwdev/server/mdserver-web && / bin/activate
|
||||
|
||||
|
||||
cd /www/server/mdserver-web && source bin/activate && source activate catalys
|
||||
cd /www/server/mdserver-web && . bin/activate && source activate catalys
|
||||
|
||||
cd /Users/midoks/Desktop/mwdev/server/mdserver-web && python3 plugins/cryptocurrency_trade/ccxt/test/p_test.py
|
||||
catalyst ingest-exchange -x binance -i btc_usdt -f minute
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[program:{$NAME}]
|
||||
command=bash -c "cd {$RUN_ROOT} && source bin/activate && python3 {$ABS_FILE} long"
|
||||
command=bash -c "cd {$RUN_ROOT} && . bin/activate && python3 {$ABS_FILE} long"
|
||||
directory={$RUN_ROOT}
|
||||
autorestart=true
|
||||
startsecs=3
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[program:{$NAME}]
|
||||
command=bash -c "cd {$RUN_ROOT} && source bin/activate && python3 plugins/cryptocurrency_trade/ccxt/public_data/data.py long"
|
||||
command=bash -c "cd {$RUN_ROOT} && . bin/activate && python3 plugins/cryptocurrency_trade/ccxt/public_data/data.py long"
|
||||
directory={$RUN_ROOT}
|
||||
autorestart=true
|
||||
startsecs=3
|
||||
|
||||
@@ -14,7 +14,7 @@ VERSION=$2
|
||||
|
||||
# pip3 install ccxt
|
||||
if [ -f ${rootPath}/bin/activate ];then
|
||||
source ${rootPath}/bin/activate
|
||||
. ${rootPath}/bin/activate
|
||||
fi
|
||||
pip3 install ccxt
|
||||
pip3 install pandas
|
||||
@@ -56,7 +56,7 @@ Uninstall_App()
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_App
|
||||
else
|
||||
Uninstall_App
|
||||
|
||||
@@ -26,7 +26,7 @@ Uninstall_App()
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_App
|
||||
else
|
||||
Uninstall_App
|
||||
|
||||
@@ -13,7 +13,7 @@ serverPath=$(dirname "$rootPath")
|
||||
VERSION=$2
|
||||
|
||||
if [ -f ${rootPath}/bin/activate ];then
|
||||
source ${rootPath}/bin/activate
|
||||
. ${rootPath}/bin/activate
|
||||
fi
|
||||
|
||||
# {
|
||||
@@ -40,7 +40,7 @@ fi
|
||||
Install_Docker()
|
||||
{
|
||||
# which docker
|
||||
# if [ "$?" == "0" ];then
|
||||
# if [ "$?" = "0" ];then
|
||||
# echo '安装已经完成docker'
|
||||
# exit 0
|
||||
# fi
|
||||
@@ -69,7 +69,7 @@ Uninstall_Docker()
|
||||
{
|
||||
CMD=yum
|
||||
which apt
|
||||
if [ "$?" == "0" ];then
|
||||
if [ "$?" = "0" ];then
|
||||
CMD=apt
|
||||
fi
|
||||
|
||||
@@ -97,7 +97,7 @@ Uninstall_Docker()
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_Docker
|
||||
else
|
||||
Uninstall_Docker
|
||||
|
||||
@@ -8,7 +8,7 @@ rootPath=$(dirname "$rootPath")
|
||||
serverPath=$(dirname "$rootPath")
|
||||
|
||||
if [ -f ${rootPath}/bin/activate ];then
|
||||
source ${rootPath}/bin/activate
|
||||
. ${rootPath}/bin/activate
|
||||
fi
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ Install_App()
|
||||
echo '正在安装脚本文件...'
|
||||
version=$1
|
||||
|
||||
if [ "macos" == "$OSNAME" ];then
|
||||
if [ "macos" = "$OSNAME" ];then
|
||||
echo "not support!"
|
||||
exit
|
||||
else
|
||||
@@ -95,7 +95,7 @@ Uninstall_App()
|
||||
|
||||
action=$1
|
||||
version=$2
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_App $version
|
||||
else
|
||||
Uninstall_App $version
|
||||
|
||||
@@ -13,13 +13,13 @@ serverPath=$(dirname "$rootPath")
|
||||
VERSION=$2
|
||||
|
||||
if [ -f ${rootPath}/bin/activate ];then
|
||||
source ${rootPath}/bin/activate
|
||||
. ${rootPath}/bin/activate
|
||||
fi
|
||||
|
||||
|
||||
OSNAME=`bash ${rootPath}/scripts/getos.sh`
|
||||
|
||||
if [ "" == "$OSNAME" ];then
|
||||
if [ "" = "$OSNAME" ];then
|
||||
OSNAME=`cat ${rootPath}/data/osname.pl`
|
||||
fi
|
||||
|
||||
@@ -83,7 +83,7 @@ Uninstall_App()
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_App
|
||||
else
|
||||
Uninstall_App
|
||||
|
||||
@@ -14,16 +14,16 @@ sysArch=`arch`
|
||||
sysName=`uname`
|
||||
|
||||
DZ_ARCH_NAME=amd64
|
||||
if [ "$sysArch" == "arm64" ];then
|
||||
if [ "$sysArch" = "arm64" ];then
|
||||
DZ_ARCH_NAME=arm64
|
||||
elif [ "$sysArch" == "x86_64" ]; then
|
||||
elif [ "$sysArch" = "x86_64" ]; then
|
||||
DZ_ARCH_NAME=amd64
|
||||
elif [ "$sysArch" == "aarch64" ]; then
|
||||
elif [ "$sysArch" = "aarch64" ]; then
|
||||
DZ_ARCH_NAME=aarch64
|
||||
fi
|
||||
|
||||
DZ_NAME=linux
|
||||
if [ "$sysName" == "Darwin" ];then
|
||||
if [ "$sysName" = "Darwin" ];then
|
||||
DZ_NAME=darwin
|
||||
fi
|
||||
Install_App()
|
||||
@@ -78,7 +78,7 @@ Uninstall_App()
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_App
|
||||
else
|
||||
Uninstall_App
|
||||
|
||||
@@ -328,7 +328,7 @@ def setBlackIp():
|
||||
mw.execShell('fail2ban-client -vvv set {jail} unbanip {ip}'.format(jail=d, ip=ip))
|
||||
|
||||
mw.writeFile(getBlackFile(), json.dumps([]))
|
||||
return nw.returnJson(True, "禁止IP成功")
|
||||
return mw.returnJson(True, "禁止IP成功")
|
||||
|
||||
# 检查IP格式
|
||||
for ip in add_ip_list:
|
||||
|
||||
@@ -67,7 +67,7 @@ Uninstall_App()
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_App
|
||||
else
|
||||
Uninstall_App
|
||||
|
||||
@@ -3,9 +3,9 @@ PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
|
||||
export PATH
|
||||
|
||||
function version_gt() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" != "$1"; }
|
||||
function version_le() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" == "$1"; }
|
||||
function version_le() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" = "$1"; }
|
||||
function version_lt() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" != "$1"; }
|
||||
function version_ge() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" == "$1"; }
|
||||
function version_ge() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" = "$1"; }
|
||||
|
||||
# cd /www/server/mdserver-web/plugins/gdrive && /bin/bash install.sh install 2.0
|
||||
|
||||
@@ -22,7 +22,7 @@ PATH=$PATH:${rootPath}/bin
|
||||
export PATH
|
||||
|
||||
# if [ -f ${rootPath}/bin/activate ];then
|
||||
# source ${rootPath}/bin/activate
|
||||
# . ${rootPath}/bin/activate
|
||||
# fi
|
||||
|
||||
VERSION=$2
|
||||
@@ -43,9 +43,9 @@ Install_App()
|
||||
echo "python3 < 3.10"
|
||||
cd ${GDDIR} && python3 -m venv .
|
||||
fi
|
||||
cd ${GDDIR} && source ${GDDIR}/bin/activate
|
||||
cd ${GDDIR} && . ${GDDIR}/bin/activate
|
||||
else
|
||||
cd ${GDDIR} && source ${GDDIR}/bin/activate
|
||||
cd ${GDDIR} && . ${GDDIR}/bin/activate
|
||||
fi
|
||||
|
||||
tmp=`python3 -V 2>&1|awk '{print $2}'`
|
||||
@@ -101,7 +101,7 @@ action=$1
|
||||
type=$2
|
||||
|
||||
echo $action $type
|
||||
if [ "${action}" == 'install' ];then
|
||||
if [ "${action}" = 'install' ];then
|
||||
Install_App
|
||||
else
|
||||
Uninstall_App
|
||||
|
||||
@@ -8,7 +8,7 @@ rootPath=$(dirname "$rootPath")
|
||||
serverPath=$(dirname "$rootPath")
|
||||
|
||||
if [ -f ${rootPath}/bin/activate ];then
|
||||
source ${rootPath}/bin/activate
|
||||
. ${rootPath}/bin/activate
|
||||
fi
|
||||
|
||||
|
||||
@@ -25,11 +25,11 @@ getBit(){
|
||||
}
|
||||
|
||||
Install_Rsync(){
|
||||
if [ "$OSNAME" == "debian" ] || [ "$OSNAME" == "ubuntu" ];then
|
||||
if [ "$OSNAME" = "debian" ] || [ "$OSNAME" = "ubuntu" ];then
|
||||
apt install -y rsync
|
||||
elif [[ "$OSNAME" == "arch" ]]; then
|
||||
elif [[ "$OSNAME" = "arch" ]]; then
|
||||
echo y | pacman -Sy rsync
|
||||
elif [[ "$OSNAME" == "macos" ]]; then
|
||||
elif [[ "$OSNAME" = "macos" ]]; then
|
||||
# brew install rsync
|
||||
# brew install lsyncd
|
||||
echo "ok"
|
||||
@@ -66,7 +66,7 @@ Install_App()
|
||||
|
||||
git config --global push.default simple
|
||||
|
||||
if [ "macos" == "$OSNAME" ];then
|
||||
if [ "macos" = "$OSNAME" ];then
|
||||
file=gitea-${version}-darwin-10.12-amd64
|
||||
else
|
||||
file=gitea-${version}-linux-amd64
|
||||
@@ -119,7 +119,7 @@ Uninstall_App()
|
||||
|
||||
action=$1
|
||||
version=$2
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_App $version
|
||||
else
|
||||
Uninstall_App $version
|
||||
|
||||
@@ -8,7 +8,7 @@ rootPath=$(dirname "$rootPath")
|
||||
serverPath=$(dirname "$rootPath")
|
||||
|
||||
if [ -f ${rootPath}/bin/activate ];then
|
||||
source ${rootPath}/bin/activate
|
||||
. ${rootPath}/bin/activate
|
||||
fi
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ GOGS_DOWNLOAD='https://dl.gogs.io'
|
||||
|
||||
getOs(){
|
||||
os=`uname`
|
||||
if [ "Darwin" == "$os" ];then
|
||||
if [ "Darwin" = "$os" ];then
|
||||
echo 'darwin'
|
||||
else
|
||||
echo 'linux'
|
||||
@@ -100,7 +100,7 @@ Uninstall_gogs()
|
||||
|
||||
action=$1
|
||||
version=$2
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_gogs $version
|
||||
else
|
||||
Uninstall_gogs $version
|
||||
|
||||
@@ -21,16 +21,16 @@ Install_App()
|
||||
mkdir -p $serverPath/source/gorse
|
||||
|
||||
SYSNAME=linux
|
||||
if [ "$sysName" == "Darwin" ];then
|
||||
if [ "$sysName" = "Darwin" ];then
|
||||
SYSNAME=darwin
|
||||
fi
|
||||
|
||||
ARCH="amd64"
|
||||
if [ "$sysArch" == "x86_64" ];then
|
||||
if [ "$sysArch" = "x86_64" ];then
|
||||
ARCH="amd64"
|
||||
elif [ "$sysArch" == "aarch64" ];then
|
||||
elif [ "$sysArch" = "aarch64" ];then
|
||||
ARCH="arm64"
|
||||
elif [ "$sysArch" == "arm64" ];then
|
||||
elif [ "$sysArch" = "arm64" ];then
|
||||
ARCH="arm64"
|
||||
else
|
||||
ARCH="amd64"
|
||||
@@ -88,7 +88,7 @@ Uninstall_App()
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_App
|
||||
else
|
||||
Uninstall_App
|
||||
|
||||
@@ -28,7 +28,7 @@ if [ "macos" == "$OSNAME" ];then
|
||||
fi
|
||||
|
||||
if [ -f ${rootPath}/bin/activate ];then
|
||||
source ${rootPath}/bin/activate
|
||||
. ${rootPath}/bin/activate
|
||||
fi
|
||||
|
||||
if id grafana &> /dev/null ;then
|
||||
|
||||
@@ -17,11 +17,11 @@ sysArch=`arch`
|
||||
sysName=`uname`
|
||||
|
||||
ARCH_NAME=amd64
|
||||
if [ "$sysArch" == "arm64" ];then
|
||||
if [ "$sysArch" = "arm64" ];then
|
||||
ARCH_NAME=arm64
|
||||
elif [ "$sysArch" == "x86_64" ]; then
|
||||
elif [ "$sysArch" = "x86_64" ]; then
|
||||
ARCH_NAME=amd64
|
||||
elif [ "$sysArch" == "aarch64" ]; then
|
||||
elif [ "$sysArch" = "aarch64" ]; then
|
||||
ARCH_NAME=aarch64
|
||||
fi
|
||||
|
||||
@@ -54,7 +54,7 @@ Uninstall_App()
|
||||
}
|
||||
|
||||
action=${1}
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_App
|
||||
else
|
||||
Uninstall_App
|
||||
|
||||
@@ -22,7 +22,7 @@ else
|
||||
useradd -g haproxy haproxy
|
||||
fi
|
||||
|
||||
if [ "${2}" == "" ];then
|
||||
if [ "${2}" = "" ];then
|
||||
echo '缺少安装脚本...'
|
||||
exit 0
|
||||
fi
|
||||
@@ -32,7 +32,7 @@ if [ ! -d $curPath/versions/$2 ];then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "${action}" == "uninstall" ];then
|
||||
if [ "${action}" = "uninstall" ];then
|
||||
|
||||
if [ -f /usr/lib/systemd/system/haproxy.service ] || [ -f /lib/systemd/system/haproxy.service ];then
|
||||
systemctl stop haproxy
|
||||
@@ -45,7 +45,7 @@ fi
|
||||
|
||||
sh -x $curPath/versions/$2/install.sh $1
|
||||
|
||||
if [ "${action}" == "install" ] && [ -d $serverPath/haproxy ];then
|
||||
if [ "${action}" = "install" ] && [ -d $serverPath/haproxy ];then
|
||||
#初始化
|
||||
cd ${rootPath} && python3 ${rootPath}/plugins/haproxy/index.py start ${type}
|
||||
cd ${rootPath} && python3 ${rootPath}/plugins/haproxy/index.py initd_install ${type}
|
||||
|
||||
@@ -31,7 +31,7 @@ Install_App()
|
||||
fi
|
||||
|
||||
|
||||
if [ "${LOCAL_ADDR}" == "cn" ];then
|
||||
if [ "${LOCAL_ADDR}" = "cn" ];then
|
||||
if [ ! -f ${APP_DIR}/haproxy-${VERSION}.tar.gz ];then
|
||||
wget -O ${APP_DIR}/haproxy-${VERSION}.tar.gz https://dl.midoks.icu/soft/haproxy/haproxy-${VERSION}.tar.gz
|
||||
fi
|
||||
@@ -39,7 +39,7 @@ Install_App()
|
||||
|
||||
|
||||
if [ ! -f ${APP_DIR}/haproxy-${VERSION}.tar.gz ];then
|
||||
if [ $sysName == 'Darwin' ]; then
|
||||
if [ $sysName = 'Darwin' ]; then
|
||||
wget --no-check-certificate -O ${APP_DIR}/haproxy-${VERSION}.tar.gz https://www.haproxy.org/download/${MIN_VERSION}/src/haproxy-${VERSION}.tar.gz
|
||||
else
|
||||
curl -sSLo ${APP_DIR}/haproxy-${VERSION}.tar.gz https://www.haproxy.org/download/${MIN_VERSION}/src/haproxy-${VERSION}.tar.gz
|
||||
@@ -94,7 +94,7 @@ Uninstall_App()
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_App
|
||||
else
|
||||
Uninstall_App
|
||||
|
||||
@@ -26,12 +26,12 @@ Install_App()
|
||||
|
||||
LOCAL_ADDR=common
|
||||
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||
if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then
|
||||
if [ ! -z "$cn" ] || [ "$?" = "0" ] ;then
|
||||
LOCAL_ADDR=cn
|
||||
fi
|
||||
|
||||
|
||||
if [ "${LOCAL_ADDR}" == "cn" ];then
|
||||
if [ "${LOCAL_ADDR}" = "cn" ];then
|
||||
if [ ! -f ${APP_DIR}/haproxy-${VERSION}.tar.gz ];then
|
||||
wget -O ${APP_DIR}/haproxy-${VERSION}.tar.gz https://dl.midoks.icu/soft/haproxy/haproxy-${VERSION}.tar.gz
|
||||
fi
|
||||
@@ -39,7 +39,7 @@ Install_App()
|
||||
|
||||
|
||||
if [ ! -f ${APP_DIR}/haproxy-${VERSION}.tar.gz ];then
|
||||
if [ $sysName == 'Darwin' ]; then
|
||||
if [ $sysName = 'Darwin' ]; then
|
||||
wget --no-check-certificate -O ${APP_DIR}/haproxy-${VERSION}.tar.gz https://www.haproxy.org/download/${MIN_VERSION}/src/haproxy-${VERSION}.tar.gz
|
||||
else
|
||||
curl -sSLo ${APP_DIR}/haproxy-${VERSION}.tar.gz https://www.haproxy.org/download/${MIN_VERSION}/src/haproxy-${VERSION}.tar.gz
|
||||
@@ -53,7 +53,7 @@ Install_App()
|
||||
|
||||
cd ${APP_DIR} && tar -zxvf haproxy-${VERSION}.tar.gz
|
||||
|
||||
if [ "$OSNAME" == "macos" ];then
|
||||
if [ "$OSNAME" = "macos" ];then
|
||||
cd ${APP_DIR}/haproxy-${VERSION} && make TARGET=osx && make install PREFIX=$serverPath/haproxy
|
||||
else
|
||||
cd ${APP_DIR}/haproxy-${VERSION} && make TARGET=linux-glibc && make install PREFIX=$serverPath/haproxy
|
||||
@@ -94,7 +94,7 @@ Uninstall_App()
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_App
|
||||
else
|
||||
Uninstall_App
|
||||
|
||||
@@ -26,12 +26,12 @@ Install_App()
|
||||
|
||||
LOCAL_ADDR=common
|
||||
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||
if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then
|
||||
if [ ! -z "$cn" ] || [ "$?" = "0" ] ;then
|
||||
LOCAL_ADDR=cn
|
||||
fi
|
||||
|
||||
|
||||
if [ "${LOCAL_ADDR}" == "cn" ];then
|
||||
if [ "${LOCAL_ADDR}" = "cn" ];then
|
||||
if [ ! -f ${APP_DIR}/haproxy-${VERSION}.tar.gz ];then
|
||||
wget -O ${APP_DIR}/haproxy-${VERSION}.tar.gz https://dl.midoks.icu/soft/haproxy/haproxy-${VERSION}.tar.gz
|
||||
fi
|
||||
@@ -39,7 +39,7 @@ Install_App()
|
||||
|
||||
|
||||
if [ ! -f ${APP_DIR}/haproxy-${VERSION}.tar.gz ];then
|
||||
if [ $sysName == 'Darwin' ]; then
|
||||
if [ $sysName = 'Darwin' ]; then
|
||||
wget --no-check-certificate -O ${APP_DIR}/haproxy-${VERSION}.tar.gz https://www.haproxy.org/download/${MIN_VERSION}/src/haproxy-${VERSION}.tar.gz
|
||||
else
|
||||
curl -sSLo ${APP_DIR}/haproxy-${VERSION}.tar.gz https://www.haproxy.org/download/${MIN_VERSION}/src/haproxy-${VERSION}.tar.gz
|
||||
@@ -53,7 +53,7 @@ Install_App()
|
||||
|
||||
cd ${APP_DIR} && tar -zxvf haproxy-${VERSION}.tar.gz
|
||||
|
||||
if [ "$OSNAME" == "macos" ];then
|
||||
if [ "$OSNAME" = "macos" ];then
|
||||
cd ${APP_DIR}/haproxy-${VERSION} && make TARGET=osx && make install PREFIX=$serverPath/haproxy
|
||||
else
|
||||
cd ${APP_DIR}/haproxy-${VERSION} && make TARGET=linux-glibc && make install PREFIX=$serverPath/haproxy
|
||||
@@ -94,7 +94,7 @@ Uninstall_App()
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_App
|
||||
else
|
||||
Uninstall_App
|
||||
|
||||
@@ -10,7 +10,7 @@ serverPath=$(dirname "$rootPath")
|
||||
action=$1
|
||||
type=$2
|
||||
|
||||
if [ "${2}" == "" ];then
|
||||
if [ "${2}" = "" ];then
|
||||
echo '缺少安装脚本...'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
@@ -21,9 +21,9 @@ ARCH="amd64"
|
||||
|
||||
get_arch() {
|
||||
TMP_ARCH=`arch`
|
||||
if [ "$TMP_ARCH" == "x86_64" ];then
|
||||
if [ "$TMP_ARCH" = "x86_64" ];then
|
||||
ARCH="amd64"
|
||||
elif [ "$TMP_ARCH" == "aarch64" ];then
|
||||
elif [ "$TMP_ARCH" = "aarch64" ];then
|
||||
ARCH="arm64"
|
||||
else
|
||||
echo $ARCH
|
||||
@@ -104,7 +104,7 @@ Uninstall_App()
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_App
|
||||
else
|
||||
Uninstall_App
|
||||
|
||||
@@ -91,7 +91,7 @@ Uninstall_App()
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_App
|
||||
else
|
||||
Uninstall_App
|
||||
|
||||
@@ -11,7 +11,7 @@ rootPath=$(dirname "$curPath")
|
||||
|
||||
SOFT=$1
|
||||
|
||||
if [ "$SOFT" == "mysql" ];then
|
||||
if [ "$SOFT" = "mysql" ];then
|
||||
bash ${rootPath}/keepalived/scripts/chk_mysql.sh > ${rootPath}/keepalived/keepalived.log
|
||||
else
|
||||
echo "you should use [chk.sh mysql] exp ."
|
||||
|
||||
@@ -11,10 +11,10 @@ serverPath=$(dirname "$rootPath")
|
||||
# cd /www/server/mdserver-web && python3 plugins/lam/index.py start
|
||||
|
||||
if [ -f ${rootPath}/bin/activate ];then
|
||||
source ${rootPath}/bin/activate
|
||||
. ${rootPath}/bin/activate
|
||||
fi
|
||||
|
||||
if [ "$sys_os" == "Darwin" ];then
|
||||
if [ "$sys_os" = "Darwin" ];then
|
||||
BAK='_bak'
|
||||
else
|
||||
BAK=''
|
||||
@@ -23,7 +23,7 @@ fi
|
||||
sysName=`uname`
|
||||
echo "use system: ${sysName}"
|
||||
|
||||
if [ "${sysName}" == "Darwin" ]; then
|
||||
if [ "${sysName}" = "Darwin" ]; then
|
||||
OSNAME='macos'
|
||||
elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
|
||||
OSNAME='centos'
|
||||
@@ -83,7 +83,7 @@ Uninstall_App()
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_App $2
|
||||
else
|
||||
Uninstall_App $2
|
||||
|
||||
@@ -38,7 +38,7 @@ Uninstall_App()
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_App
|
||||
else
|
||||
Uninstall_App
|
||||
|
||||
@@ -37,7 +37,7 @@ Uninstall_App()
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_App
|
||||
else
|
||||
Uninstall_App
|
||||
|
||||
@@ -18,17 +18,17 @@ sysName=`uname`
|
||||
echo "use system: ${sysName}"
|
||||
|
||||
OSNAME=`bash ${rootPath}/scripts/getos.sh`
|
||||
if [ "" == "$OSNAME" ];then
|
||||
if [ "" = "$OSNAME" ];then
|
||||
OSNAME=`cat ${rootPath}/data/osname.pl`
|
||||
fi
|
||||
|
||||
if [ "macos" == "$OSNAME" ];then
|
||||
if [ "macos" = "$OSNAME" ];then
|
||||
echo "不支持Macox"
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ -f ${rootPath}/bin/activate ];then
|
||||
source ${rootPath}/bin/activate
|
||||
. ${rootPath}/bin/activate
|
||||
fi
|
||||
|
||||
# if id grafana &> /dev/null ;then
|
||||
@@ -77,7 +77,7 @@ Uninstall_App()
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_App
|
||||
else
|
||||
Uninstall_App
|
||||
|
||||
@@ -18,7 +18,7 @@ Install_LVS(){
|
||||
mkdir -p $serverPath/source
|
||||
|
||||
which ipvsadm
|
||||
if [ "$?" == "0" ];then
|
||||
if [ "$?" = "0" ];then
|
||||
echo '已安装LVS!!'
|
||||
exit 0
|
||||
fi
|
||||
@@ -27,17 +27,17 @@ Install_LVS(){
|
||||
|
||||
# 检测平台命令
|
||||
which apt
|
||||
if [ "$?" == "0" ];then
|
||||
if [ "$?" = "0" ];then
|
||||
apt install -y ipvsadm
|
||||
fi
|
||||
|
||||
which yum
|
||||
if [ "$?" == "0" ];then
|
||||
if [ "$?" = "0" ];then
|
||||
yum install -y ipvsadm
|
||||
fi
|
||||
|
||||
which ipvsadm
|
||||
if [ "$?" == "0" ];then
|
||||
if [ "$?" = "0" ];then
|
||||
echo '正在安装LVS成功!'
|
||||
mkdir -p $serverPath/lvs
|
||||
|
||||
@@ -59,12 +59,12 @@ Uninstall_LVS()
|
||||
{
|
||||
# 检测平台命令
|
||||
which apt
|
||||
if [ "$?" == "0" ];then
|
||||
if [ "$?" = "0" ];then
|
||||
apt remove -y ipvsadm
|
||||
fi
|
||||
|
||||
which yum
|
||||
if [ "$?" == "0" ];then
|
||||
if [ "$?" = "0" ];then
|
||||
yum uninstall -y ipvsadm
|
||||
fi
|
||||
echo "卸载LVS完成"
|
||||
@@ -75,7 +75,7 @@ Uninstall_LVS()
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_LVS
|
||||
else
|
||||
Uninstall_LVS
|
||||
|
||||
@@ -16,18 +16,18 @@ sysArch=`arch`
|
||||
# systemctl restart manticore
|
||||
|
||||
if [ -f ${rootPath}/bin/activate ];then
|
||||
source ${rootPath}/bin/activate
|
||||
. ${rootPath}/bin/activate
|
||||
fi
|
||||
|
||||
ACTION=$1
|
||||
VERSION=$2
|
||||
|
||||
which apt
|
||||
if [ "$?" == "0" ];then
|
||||
if [ "$?" = "0" ];then
|
||||
sh -x $curPath/versions/apt/install.sh $1 $2
|
||||
fi
|
||||
|
||||
which yum
|
||||
if [ "$?" == "0" ];then
|
||||
if [ "$?" = "0" ];then
|
||||
sh -x $curPath/versions/yum/install.sh $1 $2
|
||||
fi
|
||||
|
||||
@@ -10,7 +10,7 @@ sysName=`uname`
|
||||
sysArch=`arch`
|
||||
|
||||
if [ -f ${rootPath}/bin/activate ];then
|
||||
source ${rootPath}/bin/activate
|
||||
. ${rootPath}/bin/activate
|
||||
fi
|
||||
|
||||
VERSION=$2
|
||||
|
||||
@@ -11,7 +11,7 @@ sysArch=`arch`
|
||||
|
||||
|
||||
if [ -f ${rootPath}/bin/activate ];then
|
||||
source ${rootPath}/bin/activate
|
||||
. ${rootPath}/bin/activate
|
||||
fi
|
||||
|
||||
VERSION=$2
|
||||
@@ -60,7 +60,7 @@ Uninstall_App()
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_App
|
||||
else
|
||||
Uninstall_App
|
||||
|
||||
@@ -878,7 +878,7 @@ def importDbExternalProgress():
|
||||
file = args['file']
|
||||
name = args['name']
|
||||
|
||||
cmd = 'cd '+mw.getServerDir()+'/mdserver-web && source bin/activate && '
|
||||
cmd = 'cd '+mw.getServerDir()+'/mdserver-web && . bin/activate && '
|
||||
cmd += 'python3 '+mw.getServerDir()+'/mdserver-web/plugins/mariadb/index.py import_db_external_progress_bar {"file":"'+file+'","name":"'+name+'"}'
|
||||
return mw.returnJson(True, 'ok',cmd)
|
||||
|
||||
@@ -2601,7 +2601,7 @@ def initSlaveStatusSSH(version=''):
|
||||
username='root', pkey=key)
|
||||
|
||||
db_user = data['db_user']
|
||||
cmd = 'cd /www/server/mdserver-web && source bin/activate && python3 plugins/mariadb/index.py get_master_rep_slave_user_cmd_ssh {"username":"' + db_user + '","db":""}'
|
||||
cmd = 'cd /www/server/mdserver-web && . bin/activate && python3 plugins/mariadb/index.py get_master_rep_slave_user_cmd_ssh {"username":"' + db_user + '","db":""}'
|
||||
stdin, stdout, stderr = ssh.exec_command(cmd)
|
||||
result = stdout.read()
|
||||
result = result.decode('utf-8')
|
||||
@@ -2753,7 +2753,7 @@ def syncDatabaseRepairLog(version=''):
|
||||
sync_args_sign = args['sign']
|
||||
op = args['op']
|
||||
tmp_log = syncDatabaseRepairTempFile()
|
||||
cmd = 'cd '+mw.getServerDir()+'/mdserver-web && source bin/activate && python3 plugins/mariadb/index.py sync_database_repair {"db":"'+sync_args_db+'","sign":"'+sync_args_sign+'"}'
|
||||
cmd = 'cd '+mw.getServerDir()+'/mdserver-web && . bin/activate && python3 plugins/mariadb/index.py sync_database_repair {"db":"'+sync_args_db+'","sign":"'+sync_args_sign+'"}'
|
||||
# print(cmd)
|
||||
|
||||
if op == 'get':
|
||||
@@ -3062,7 +3062,7 @@ def fullSyncCmd():
|
||||
db = args['db']
|
||||
sign = args['sign']
|
||||
|
||||
cmd = 'cd '+mw.getServerDir()+'/mdserver-web && source bin/activate && python3 plugins/mariadb/index.py do_full_sync {"db":"'+db+'","sign":"'+sign+'"}'
|
||||
cmd = 'cd '+mw.getServerDir()+'/mdserver-web && . bin/activate && python3 plugins/mariadb/index.py do_full_sync {"db":"'+db+'","sign":"'+sign+'"}'
|
||||
return mw.returnJson(True,'ok',cmd)
|
||||
|
||||
# python3 plugins/mariadb/index.py do_full_sync {"db":"demo1","sign":"","beigin":"1"}
|
||||
@@ -3247,7 +3247,7 @@ def doFullSyncSSH(version=''):
|
||||
|
||||
writeDbSyncStatus({'code': 0, 'msg': '登录Master成功...', 'progress': 5})
|
||||
dbname = args['db']
|
||||
cmd = "cd /www/server/mdserver-web && source bin/activate && python3 plugins/mariadb/index.py dump_mysql_data {\"db\":'" + dbname + "'}"
|
||||
cmd = "cd /www/server/mdserver-web && . bin/activate && python3 plugins/mariadb/index.py dump_mysql_data {\"db\":'" + dbname + "'}"
|
||||
print(cmd)
|
||||
stdin, stdout, stderr = ssh.exec_command(cmd)
|
||||
result = stdout.read()
|
||||
@@ -3270,7 +3270,7 @@ def doFullSyncSSH(version=''):
|
||||
if copy_status == None:
|
||||
writeDbSyncStatus({'code': 2, 'msg': '数据同步本地完成...', 'progress': 40})
|
||||
|
||||
cmd = 'cd /www/server/mdserver-web && source bin/activate && python3 plugins/mariadb/index.py get_master_rep_slave_user_cmd {"username":"' + db_user + '","db":""}'
|
||||
cmd = 'cd /www/server/mdserver-web && . bin/activate && python3 plugins/mariadb/index.py get_master_rep_slave_user_cmd {"username":"' + db_user + '","db":""}'
|
||||
stdin, stdout, stderr = ssh.exec_command(cmd)
|
||||
result = stdout.read()
|
||||
result = result.decode('utf-8')
|
||||
|
||||
@@ -8,11 +8,11 @@ rootPath=$(dirname "$rootPath")
|
||||
serverPath=$(dirname "$rootPath")
|
||||
|
||||
# cd /www/server/mdserver-web/plugins/mariadb && bash install.sh install 8.2
|
||||
# cd /www/server/mdserver-web && source bin/activate && python3 plugins/mariadb/index.py try_slave_sync_bugfix {}
|
||||
# cd /www/server/mdserver-web && source bin/activate && python3 plugins/mariadb/index.py do_full_sync {"db":"xxx","sign":"","begin":1}
|
||||
# cd /www/server/mdserver-web && source bin/activate && python3 plugins/mariadb/index.py sync_database_repair {"db":"xxx","sign":""}
|
||||
# cd /www/server/mdserver-web && source bin/activate && python3 plugins/mariadb/index.py init_slave_status
|
||||
# cd /www/server/mdserver-web && source bin/activate && python3 plugins/mariadb/index.py install_pre_inspection
|
||||
# cd /www/server/mdserver-web && . bin/activate && python3 plugins/mariadb/index.py try_slave_sync_bugfix {}
|
||||
# cd /www/server/mdserver-web && . bin/activate && python3 plugins/mariadb/index.py do_full_sync {"db":"xxx","sign":"","begin":1}
|
||||
# cd /www/server/mdserver-web && . bin/activate && python3 plugins/mariadb/index.py sync_database_repair {"db":"xxx","sign":""}
|
||||
# cd /www/server/mdserver-web && . bin/activate && python3 plugins/mariadb/index.py init_slave_status
|
||||
# cd /www/server/mdserver-web && . bin/activate && python3 plugins/mariadb/index.py install_pre_inspection
|
||||
|
||||
|
||||
action=$1
|
||||
@@ -26,7 +26,7 @@ else
|
||||
useradd -g mysql -s /usr/sbin/nologin mysql
|
||||
fi
|
||||
|
||||
if [ "${2}" == "" ];then
|
||||
if [ "${2}" = "" ];then
|
||||
echo '缺少安装脚本...'
|
||||
exit 0
|
||||
fi
|
||||
@@ -36,7 +36,7 @@ if [ ! -d $curPath/versions/$2 ];then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "${action}" == "uninstall" ];then
|
||||
if [ "${action}" = "uninstall" ];then
|
||||
|
||||
if [ -f /usr/lib/systemd/system/mariadb.service ] || [ -f /lib/systemd/system/mariadb.service ];then
|
||||
systemctl stop mariadb
|
||||
@@ -49,7 +49,7 @@ fi
|
||||
|
||||
sh -x $curPath/versions/$2/install.sh $1
|
||||
|
||||
if [ "${action}" == "install" ] && [ -d $serverPath/mariadb ];then
|
||||
if [ "${action}" = "install" ] && [ -d $serverPath/mariadb ];then
|
||||
#初始化
|
||||
cd ${rootPath} && python3 ${rootPath}/plugins/mariadb/index.py start ${type}
|
||||
cd ${rootPath} && python3 ${rootPath}/plugins/mariadb/index.py initd_install ${type}
|
||||
|
||||
@@ -113,7 +113,7 @@ Uninstall_app()
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_app
|
||||
else
|
||||
Uninstall_app
|
||||
|
||||
@@ -71,7 +71,7 @@ Install_app()
|
||||
|
||||
INSTALL_CMD=cmake
|
||||
CMAKE3=`which cmake3`
|
||||
if [ "$?" == "0" ];then
|
||||
if [ "$?" = "0" ];then
|
||||
INSTALL_CMD=cmake3
|
||||
fi
|
||||
|
||||
@@ -116,7 +116,7 @@ Uninstall_app()
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_app
|
||||
else
|
||||
Uninstall_app
|
||||
|
||||
@@ -103,7 +103,7 @@ Uninstall_app()
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_app
|
||||
else
|
||||
Uninstall_app
|
||||
|
||||
@@ -103,7 +103,7 @@ Uninstall_app()
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_app
|
||||
else
|
||||
Uninstall_app
|
||||
|
||||
@@ -113,7 +113,7 @@ Uninstall_app()
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_app
|
||||
else
|
||||
Uninstall_app
|
||||
|
||||
@@ -113,7 +113,7 @@ Uninstall_app()
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_app
|
||||
else
|
||||
Uninstall_app
|
||||
|
||||
@@ -113,7 +113,7 @@ Uninstall_app()
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_app
|
||||
else
|
||||
Uninstall_app
|
||||
|
||||
@@ -113,7 +113,7 @@ Uninstall_app()
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_app
|
||||
else
|
||||
Uninstall_app
|
||||
|
||||
@@ -113,7 +113,7 @@ Uninstall_app()
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_app
|
||||
else
|
||||
Uninstall_app
|
||||
|
||||
@@ -113,7 +113,7 @@ Uninstall_app()
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_app
|
||||
else
|
||||
Uninstall_app
|
||||
|
||||
@@ -113,7 +113,7 @@ Uninstall_app()
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_app
|
||||
else
|
||||
Uninstall_app
|
||||
|
||||
@@ -113,7 +113,7 @@ Uninstall_app()
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_app
|
||||
else
|
||||
Uninstall_app
|
||||
|
||||
@@ -113,7 +113,7 @@ Uninstall_app()
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_app
|
||||
else
|
||||
Uninstall_app
|
||||
|
||||
@@ -113,7 +113,7 @@ Uninstall_app()
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_app
|
||||
else
|
||||
Uninstall_app
|
||||
|
||||
@@ -113,7 +113,7 @@ Uninstall_app()
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_app
|
||||
else
|
||||
Uninstall_app
|
||||
|
||||
@@ -8,7 +8,7 @@ rootPath=$(dirname "$rootPath")
|
||||
serverPath=$(dirname "$rootPath")
|
||||
|
||||
sys_os=`uname`
|
||||
VERSION=1.6.39
|
||||
VERSION=1.6.42
|
||||
|
||||
echo $sys_os
|
||||
|
||||
@@ -24,7 +24,7 @@ Install_mem(){
|
||||
cd $serverPath/source/memcached && tar -zxvf memcached.tar.gz
|
||||
|
||||
OPTIONS=''
|
||||
if [ ${sys_os} == "Darwin" ]; then
|
||||
if [ ${sys_os} = "Darwin" ]; then
|
||||
LIB_DEPEND_DIR=`brew info libevent | grep /opt/homebrew/Cellar/libevent | cut -d \ -f 1 | awk 'END {print}'`
|
||||
OPTIONS="${OPTIONS} --with-libevent=${LIB_DEPEND_DIR}"
|
||||
fi
|
||||
@@ -68,7 +68,7 @@ Uninstall_mem()
|
||||
# /www/server/memcached/bin/memcached -d -p 11211 -u root -m 100 -c 100
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_mem
|
||||
else
|
||||
Uninstall_mem
|
||||
|
||||
@@ -98,7 +98,7 @@ class classApi:
|
||||
os.remove(log_file)
|
||||
|
||||
plugins_dir = mw.getServerDir() + '/mdserver-web'
|
||||
exe = "cd {0} && source bin/activate && python3 plugins/migration_api/index.py bg_process &>{1} &".format(
|
||||
exe = "cd {0} && . bin/activate && python3 plugins/migration_api/index.py bg_process &>{1} &".format(
|
||||
plugins_dir, log_file_error)
|
||||
# mw.execShell(exe)
|
||||
# os.system(exe)
|
||||
|
||||
@@ -9,7 +9,7 @@ rootPath=$(dirname "$rootPath")
|
||||
serverPath=$(dirname "$rootPath")
|
||||
|
||||
|
||||
# cd /www/server/mdserver-web && source bin/activate && python3 plugins/migration_api/index.py bg_process
|
||||
# cd /www/server/mdserver-web && . bin/activate && python3 plugins/migration_api/index.py bg_process
|
||||
|
||||
VERSION=1.0
|
||||
|
||||
@@ -25,7 +25,7 @@ Uninstall_App()
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_App
|
||||
else
|
||||
Uninstall_App
|
||||
|
||||
@@ -154,8 +154,8 @@ def checkArgs(data, ck=[]):
|
||||
return (True, mw.returnJson(True, 'ok'))
|
||||
|
||||
def status():
|
||||
data = mw.execShell(
|
||||
"ps -ef|grep mongod |grep -v mongosh|grep -v grep | grep -v /Applications | grep -v python | grep -v mdserver-web | awk '{print $2}'")
|
||||
cmd = "ps -ef|grep mongod |grep -v mongosh|grep -v grep | grep -v /Applications | grep -v python | grep -v mdserver-web | awk '{print $2}'"
|
||||
data = mw.execShell(cmd)
|
||||
if data[0] == '':
|
||||
return 'stop'
|
||||
return 'start'
|
||||
@@ -465,7 +465,7 @@ def setConfigAuth():
|
||||
|
||||
def runInfo():
|
||||
'''
|
||||
cd /www/server/mdserver-web && source bin/activate && python3 /www/server/mdserver-web/plugins/mongodb/index.py run_info
|
||||
cd /www/server/mdserver-web && . bin/activate && python3 /www/server/mdserver-web/plugins/mongodb/index.py run_info
|
||||
'''
|
||||
client = mongdbClient()
|
||||
db = client.admin
|
||||
@@ -1451,7 +1451,7 @@ def importDbBackup():
|
||||
|
||||
def testData():
|
||||
'''
|
||||
cd /www/server/mdserver-web && source bin/activate && python3 /www/server/mdserver-web/plugins/mongodb/index.py test_data
|
||||
cd /www/server/mdserver-web && . bin/activate && python3 /www/server/mdserver-web/plugins/mongodb/index.py test_data
|
||||
'''
|
||||
import pymongo
|
||||
from pymongo import ReadPreference
|
||||
@@ -1470,7 +1470,7 @@ def testData():
|
||||
def test():
|
||||
'''
|
||||
python3 /www/server/mdserver-web/plugins/mongodb/index.py set_config_auth {}
|
||||
cd /www/server/mdserver-web && source bin/activate && python3 /www/server/mdserver-web/plugins/mongodb/index.py test
|
||||
cd /www/server/mdserver-web && . bin/activate && python3 /www/server/mdserver-web/plugins/mongodb/index.py test
|
||||
python3 plugins/mongodb/index.py test
|
||||
'''
|
||||
# https://pymongo.readthedocs.io/en/stable/examples/high_availability.html
|
||||
|
||||
@@ -23,9 +23,9 @@ SYS_VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | a
|
||||
Install_app_mac()
|
||||
{
|
||||
mkdir -p $serverPath/mongodb
|
||||
if [ "$VERSION" == "5.0" ];then
|
||||
if [ "$VERSION" = "5.0" ];then
|
||||
G_VERSION="5.0.11"
|
||||
elif [[ "$VERSION" == "4.4" ]]; then
|
||||
elif [[ "$VERSION" = "4.4" ]]; then
|
||||
G_VERSION="4.4.11"
|
||||
fi
|
||||
|
||||
@@ -41,7 +41,7 @@ Install_app_mac()
|
||||
Install_Linux_Ubuntu()
|
||||
{
|
||||
##################### Ubuntu start #####################
|
||||
if [ "$SYS_VERSION_ID" == "22" ]; then
|
||||
if [ "$SYS_VERSION_ID" = "22" ]; then
|
||||
echo "Not yet supported"
|
||||
exit 1
|
||||
fi
|
||||
@@ -52,11 +52,11 @@ fi
|
||||
echo $SYS_VERSION_ID
|
||||
|
||||
SOURCE_NAME=bionic
|
||||
if [ "$SYS_VERSION_ID" == "18.04" ];then
|
||||
if [ "$SYS_VERSION_ID" = "18.04" ];then
|
||||
SOURCE_NAME=bionic
|
||||
elif [ "$SYS_VERSION_ID" == "16.04" ];then
|
||||
elif [ "$SYS_VERSION_ID" = "16.04" ];then
|
||||
SOURCE_NAME=xenial
|
||||
elif [ "$SYS_VERSION_ID" == "20.04" ];then
|
||||
elif [ "$SYS_VERSION_ID" = "20.04" ];then
|
||||
SOURCE_NAME=focal
|
||||
fi
|
||||
|
||||
@@ -210,13 +210,13 @@ rm -rf /etc/yum.repos.d/mongodb-org-${VERSION}.repo
|
||||
|
||||
Install_app_linux()
|
||||
{
|
||||
if [ "$OSNAME" == "ubuntu" ];then
|
||||
if [ "$OSNAME" = "ubuntu" ];then
|
||||
Install_Linux_Ubuntu
|
||||
elif [ "$OSNAME" == "debian" ];then
|
||||
elif [ "$OSNAME" = "debian" ];then
|
||||
Install_Linux_Debian
|
||||
elif [ "$OSNAME" == "centos" ];then
|
||||
elif [ "$OSNAME" = "centos" ];then
|
||||
Install_Linux_CentOS
|
||||
elif [ "$OSNAME" == "opensuse" ];then
|
||||
elif [ "$OSNAME" = "opensuse" ];then
|
||||
Install_Linux_Opensuse
|
||||
else
|
||||
echo "Not yet supported"
|
||||
@@ -230,13 +230,13 @@ Install_app()
|
||||
echo '正在安装脚本文件...'
|
||||
mkdir -p $serverPath/source
|
||||
|
||||
if [ "macos" == "$OSNAME" ];then
|
||||
if [ "macos" = "$OSNAME" ];then
|
||||
Install_app_mac
|
||||
else
|
||||
Install_app_linux
|
||||
fi
|
||||
|
||||
if [ "$?" == "0" ];then
|
||||
if [ "$?" = "0" ];then
|
||||
mkdir -p $serverPath/mongodb
|
||||
echo "${VERSION}" > $serverPath/mongodb/version.pl
|
||||
echo '安装完成'
|
||||
@@ -252,13 +252,13 @@ Install_app()
|
||||
Uninstall_app_linux()
|
||||
{
|
||||
##################
|
||||
if [ "$OSNAME" == "ubuntu" ];then
|
||||
if [ "$OSNAME" = "ubuntu" ];then
|
||||
Uninstall_Linux_Ubuntu
|
||||
elif [ "$OSNAME" == "debian" ];then
|
||||
elif [ "$OSNAME" = "debian" ];then
|
||||
Uninstall_Linux_Debian
|
||||
elif [ "$OSNAME" == "centos" ];then
|
||||
elif [ "$OSNAME" = "centos" ];then
|
||||
Uninstall_Linux_CentOS
|
||||
elif [ "$OSNAME" == "opensuse" ];then
|
||||
elif [ "$OSNAME" = "opensuse" ];then
|
||||
Uninstall_Linux_Opensuse
|
||||
else
|
||||
echo "ok"
|
||||
@@ -268,7 +268,7 @@ fi
|
||||
|
||||
Uninstall_app()
|
||||
{
|
||||
if [ "macos" == "$OSNAME" ];then
|
||||
if [ "macos" = "$OSNAME" ];then
|
||||
echo 'mac'
|
||||
else
|
||||
Uninstall_app_linux
|
||||
@@ -279,7 +279,7 @@ Uninstall_app()
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_app
|
||||
else
|
||||
Uninstall_app
|
||||
|
||||
@@ -79,7 +79,7 @@ Install_app()
|
||||
--ssl=off CPPPATH=$serverPath/lib/openssl/include \
|
||||
LIBPATH=$serverPath/lib/openssl/lib"
|
||||
|
||||
if [ "$?" == "0" ];then
|
||||
if [ "$?" = "0" ];then
|
||||
mkdir -p $serverPath/mongodb
|
||||
echo "${VERSION}" > $serverPath/mongodb/version.pl
|
||||
echo '安装完成'
|
||||
@@ -99,7 +99,7 @@ Uninstall_app()
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_app
|
||||
else
|
||||
Uninstall_app
|
||||
|
||||
+10
-24
@@ -6,6 +6,7 @@ export PATH
|
||||
|
||||
# cd /Users/midoks/Desktop/mwdev/server/mdserver-web/plugins/mongodb && /bin/bash install.sh install 7.0
|
||||
# cd /www/server/mdserver-web/plugins/mongodb && /bin/bash install.sh install 7.0
|
||||
# cd /www/server/mdserver-web/plugins/mongodb && /bin/bash install.sh install 8.0
|
||||
# cd /www/server/mdserver-web/plugins/mongodb && /bin/bash install.sh install 3.0
|
||||
# cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mongodb/index.py start
|
||||
|
||||
@@ -42,45 +43,30 @@ if [ "macos" != "$OSNAME" ];then
|
||||
fi
|
||||
|
||||
if [ -f ${rootPath}/bin/activate ];then
|
||||
source ${rootPath}/bin/activate
|
||||
. ${rootPath}/bin/activate
|
||||
fi
|
||||
Install_app()
|
||||
{
|
||||
echo '正在安装脚本文件...'
|
||||
mkdir -p $serverPath/source
|
||||
|
||||
# if id mongodb &> /dev/null ;then
|
||||
# echo "mongodb uid is `id -u mongodb`"
|
||||
# echo "mongodb shell is `grep "^mongodb:" /etc/passwd |cut -d':' -f7 `"
|
||||
# else
|
||||
# groupadd mongodb
|
||||
# useradd -g mongodb mongodb
|
||||
# fi
|
||||
|
||||
# if [ "centos" == "$OSNAME" ];then
|
||||
# OSNAME=rhel
|
||||
# fi
|
||||
|
||||
# if [ "fedora" == "$OSNAME" ];then
|
||||
# OSNAME=rhel
|
||||
# fi
|
||||
|
||||
# if [ "rocky" == "$OSNAME" ];then
|
||||
# OSNAME=rhel
|
||||
# fi
|
||||
|
||||
cd ${rootPath}/plugins/php/lib && /bin/bash openssl_11.sh
|
||||
|
||||
shell_file=${curPath}/versions/${VERSION}/${OSNAME}.sh
|
||||
|
||||
if [ -f $shell_file ];then
|
||||
bash -x $shell_file
|
||||
|
||||
if [ "$?" != "0" ];then
|
||||
echo '不支持...'
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo '不支持...'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$?" == "0" ];then
|
||||
if [ "$?" = "0" ];then
|
||||
mkdir -p $serverPath/mongodb
|
||||
echo "${VERSION}" > $serverPath/mongodb/version.pl
|
||||
echo 'mongodb安装完成'
|
||||
@@ -90,7 +76,7 @@ Install_app()
|
||||
cd ${rootPath} && python3 ${rootPath}/plugins/mongodb/index.py initd_install
|
||||
fi
|
||||
|
||||
if [ "${VERSION}" == "3.0" ];then
|
||||
if [ "${VERSION}" = "3.0" ];then
|
||||
# 降低版本
|
||||
pip install pymongo==3.12.0
|
||||
else
|
||||
@@ -116,7 +102,7 @@ Uninstall_app()
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
if [ "${1}" = 'install' ];then
|
||||
Install_app
|
||||
else
|
||||
Uninstall_app
|
||||
|
||||
@@ -11,6 +11,11 @@ serverPath=$(dirname "$rootPath")
|
||||
VERSION=3.0.15
|
||||
SYS_ARCH=`arch`
|
||||
|
||||
if [ "$SYS_ARCH" != "x86_64" ];then
|
||||
echo "no support"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
SYS_VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'`
|
||||
SYS_NAME=${SYS_VERSION_ID/./}
|
||||
SYS_NAME_LEN=`echo "$SYS_NAME" | wc -L`
|
||||
@@ -60,7 +65,7 @@ if [ ! -d $MG_DIR/${FILE_NAME} ];then
|
||||
cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ}
|
||||
fi
|
||||
|
||||
if [ ! -d $serverPath/mongodb/bin ];then
|
||||
if [ ! -f $serverPath/mongodb/bin/mongod ];then
|
||||
mkdir -p $serverPath/mongodb
|
||||
cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb
|
||||
fi
|
||||
|
||||
@@ -11,6 +11,12 @@ serverPath=$(dirname "$rootPath")
|
||||
# https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.0.15.tgz
|
||||
VERSION=3.0.15
|
||||
SYS_ARCH=`arch`
|
||||
|
||||
if [ "$SYS_ARCH" != "x86_64" ];then
|
||||
echo "no support"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
SYS_VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'`
|
||||
SYS_NAME=${SYS_VERSION_ID/./}
|
||||
|
||||
@@ -39,7 +45,7 @@ if [ ! -d $MG_DIR/${FILE_NAME_TGZ} ];then
|
||||
cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ}
|
||||
fi
|
||||
|
||||
if [ ! -d $serverPath/mongodb/bin ];then
|
||||
if [ ! -f $serverPath/mongodb/bin/mongod ];then
|
||||
mkdir -p $serverPath/mongodb
|
||||
cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb
|
||||
fi
|
||||
|
||||
@@ -23,7 +23,7 @@ if [ ! -d $MG_DIR/mongodb-macos-x86_64-${VERSION} ];then
|
||||
cd $MG_DIR && tar -zxvf mongodb-macos-x86_64-${VERSION}.tgz
|
||||
fi
|
||||
|
||||
if [ ! -d $serverPath/mongodb/bin ];then
|
||||
if [ ! -f $serverPath/mongodb/bin/mongod ];then
|
||||
mkdir -p $serverPath/mongodb
|
||||
cd $MG_DIR/mongodb-macos-x86_64-${VERSION} && cp -rf ./bin $serverPath/mongodb
|
||||
fi
|
||||
|
||||
@@ -11,6 +11,11 @@ serverPath=$(dirname "$rootPath")
|
||||
VERSION=3.0.15
|
||||
SYS_ARCH=`arch`
|
||||
|
||||
if [ "$SYS_ARCH" != "x86_64" ];then
|
||||
echo "no support"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
SYS_VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}' | awk -F . '{print $1}'`
|
||||
|
||||
SYS_NAME="15"
|
||||
@@ -40,7 +45,7 @@ if [ ! -d $MG_DIR/${FILE_NAME} ];then
|
||||
cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ}
|
||||
fi
|
||||
|
||||
if [ ! -d $serverPath/mongodb/bin ];then
|
||||
if [ ! -f $serverPath/mongodb/bin/mongod ];then
|
||||
mkdir -p $serverPath/mongodb
|
||||
cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb
|
||||
fi
|
||||
|
||||
@@ -36,7 +36,7 @@ if [ ! -d $MG_DIR/${FILE_NAME} ];then
|
||||
cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ}
|
||||
fi
|
||||
|
||||
if [ ! -d $serverPath/mongodb/bin ];then
|
||||
if [ ! -f $serverPath/mongodb/bin/mongod ];then
|
||||
mkdir -p $serverPath/mongodb
|
||||
cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb
|
||||
fi
|
||||
|
||||
@@ -11,6 +11,11 @@ serverPath=$(dirname "$rootPath")
|
||||
VERSION=3.0.15
|
||||
SYS_ARCH=`arch`
|
||||
|
||||
if [ "$SYS_ARCH" != "x86_64" ];then
|
||||
echo "no support"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SYS_VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'`
|
||||
SYS_NAME=${SYS_VERSION_ID/./}
|
||||
# https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2004-4.4.23.tgz
|
||||
@@ -38,7 +43,7 @@ if [ ! -d $MG_DIR/${FILE_NAME} ];then
|
||||
cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ}
|
||||
fi
|
||||
|
||||
if [ ! -d $serverPath/mongodb/bin ];then
|
||||
if [ ! -f $serverPath/mongodb/bin/mongod ];then
|
||||
mkdir -p $serverPath/mongodb
|
||||
cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb
|
||||
fi
|
||||
|
||||
@@ -60,7 +60,7 @@ if [ ! -d $MG_DIR/${FILE_NAME} ];then
|
||||
cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ}
|
||||
fi
|
||||
|
||||
if [ ! -d $serverPath/mongodb/bin ];then
|
||||
if [ ! -f $serverPath/mongodb/bin/mongod ];then
|
||||
mkdir -p $serverPath/mongodb
|
||||
cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb
|
||||
fi
|
||||
@@ -89,11 +89,11 @@ cd ${MG_DIR} && rm -rf ${MG_DIR}/${TOOL_FILE_NAME}
|
||||
#--------------- mongodb database install ------------------ #
|
||||
TOOL_VERSION=100.9.4
|
||||
TOOL_FILE_NAME=mongodb-database-tools-rhel${SYS_NAME}-x86_64-${TOOL_VERSION}
|
||||
if [ "aarch64" == ${SYS_ARCH} ];then
|
||||
if [ "aarch64" = ${SYS_ARCH} ];then
|
||||
TOOL_FILE_NAME=mongodb-database-tools-rhel${SYS_NAME}-aarch64-${TOOL_VERSION}
|
||||
fi
|
||||
|
||||
if [ "arm64" == ${SYS_ARCH} ];then
|
||||
if [ "arm64" = ${SYS_ARCH} ];then
|
||||
TOOL_FILE_NAME=mongodb-database-tools-rhel${SYS_NAME}-arm64-${TOOL_VERSION}
|
||||
fi
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ if [ ! -d $MG_DIR/${FILE_NAME_TGZ} ];then
|
||||
cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ}
|
||||
fi
|
||||
|
||||
if [ ! -d $serverPath/mongodb/bin ];then
|
||||
if [ ! -f $serverPath/mongodb/bin/mongod ];then
|
||||
mkdir -p $serverPath/mongodb
|
||||
cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb
|
||||
fi
|
||||
|
||||
@@ -22,7 +22,7 @@ if [ ! -d $MG_DIR/mongodb-macos-x86_64-${VERSION} ];then
|
||||
cd $MG_DIR && tar -zxvf mongodb-macos-x86_64-${VERSION}.tgz
|
||||
fi
|
||||
|
||||
if [ ! -d $serverPath/mongodb/bin ];then
|
||||
if [ ! -f $serverPath/mongodb/bin/mongod ];then
|
||||
mkdir -p $serverPath/mongodb
|
||||
cd $MG_DIR/mongodb-macos-x86_64-${VERSION} && cp -rf ./bin $serverPath/mongodb
|
||||
fi
|
||||
|
||||
@@ -40,7 +40,7 @@ if [ ! -d $MG_DIR/${FILE_NAME} ];then
|
||||
cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ}
|
||||
fi
|
||||
|
||||
if [ ! -d $serverPath/mongodb/bin ];then
|
||||
if [ ! -f $serverPath/mongodb/bin/mongod ];then
|
||||
mkdir -p $serverPath/mongodb
|
||||
cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb
|
||||
fi
|
||||
|
||||
@@ -36,7 +36,7 @@ if [ ! -d $MG_DIR/${FILE_NAME} ];then
|
||||
cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ}
|
||||
fi
|
||||
|
||||
if [ ! -d $serverPath/mongodb/bin ];then
|
||||
if [ ! -f $serverPath/mongodb/bin/mongod ];then
|
||||
mkdir -p $serverPath/mongodb
|
||||
cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb
|
||||
fi
|
||||
|
||||
@@ -38,7 +38,7 @@ if [ ! -d $MG_DIR/${FILE_NAME} ];then
|
||||
cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ}
|
||||
fi
|
||||
|
||||
if [ ! -d $serverPath/mongodb/bin ];then
|
||||
if [ ! -f $serverPath/mongodb/bin/mongod ];then
|
||||
mkdir -p $serverPath/mongodb
|
||||
cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb
|
||||
fi
|
||||
@@ -48,7 +48,7 @@ cd ${MG_DIR} && rm -rf ${MG_DIR}/${FILE_NAME}
|
||||
#--------------- mongosh tool install ------------------ #
|
||||
TOOL_VERSION=2.2.5
|
||||
TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-linux-x64
|
||||
if [ "aarch64" == ${SYS_ARCH} ];then
|
||||
if [ "aarch64" = ${SYS_ARCH} ];then
|
||||
TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-linux-arm64
|
||||
fi
|
||||
TOOL_FILE_NAME_TGZ=${TOOL_FILE_NAME}.tgz
|
||||
@@ -68,11 +68,11 @@ cd ${MG_DIR} && rm -rf ${MG_DIR}/${TOOL_FILE_NAME}
|
||||
#--------------- mongodb database install ------------------ #
|
||||
TOOL_VERSION=100.9.4
|
||||
TOOL_FILE_NAME=mongodb-database-tools-ubuntu${SYS_NAME}-x86_64-${TOOL_VERSION}
|
||||
if [ "aarch64" == ${SYS_ARCH} ];then
|
||||
if [ "aarch64" = ${SYS_ARCH} ];then
|
||||
TOOL_FILE_NAME=mongodb-database-tools-ubuntu${SYS_NAME}-arm64-${TOOL_VERSION}
|
||||
fi
|
||||
|
||||
if [ "arm64" == ${SYS_ARCH} ];then
|
||||
if [ "arm64" = ${SYS_ARCH} ];then
|
||||
TOOL_FILE_NAME=mongodb-database-tools-ubuntu${SYS_NAME}-arm64-${TOOL_VERSION}
|
||||
fi
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user