forked from midoks/mdserver-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate_centos.sh
executable file
·59 lines (46 loc) · 1.43 KB
/
update_centos.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
LANG=en_US.UTF-8
if [ -f /etc/motd ];then
echo "Welcome to mdserver-web panel" > /etc/motd
fi
sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config
wget -O /tmp/master.zip https://codeload.github.com/midoks/mdserver-web/zip/master
cd /tmp && unzip /tmp/master.zip
/usr/bin/cp -rf /tmp/mdserver-web-master/* /www/server/mdserver-web
rm -rf /tmp/master.zip
rm -rf /tmp/mdserver-web-master
yum install -y curl-devel
cd /www/server/mdserver-web/scripts && sh lib.sh
pip install -r /www/server/mdserver-web/requirements.txt
sh /etc/init.d/mw stop && rm -rf /www/server/mdserver-web/scripts/init.d/mw && rm -rf /etc/init.d/mw
echo -e "stop mw"
isStart=`ps -ef|grep 'gunicorn -c setting.py app:app' |grep -v grep|awk '{print $2}'`
port=$(cat /www/server/mdserver-web/data/port.pl)
n=0
while [[ "$isStart" != "" ]];
do
echo -e ".\c"
sleep 0.5
isStart=$(lsof -n -P -i:$port|grep LISTEN|grep -v grep|awk '{print $2}'|xargs)
let n+=1
if [ $n -gt 15 ];then
break;
fi
done
echo -e "start mw"
cd /www/server/mdserver-web && sh cli.sh start
isStart=`ps -ef|grep 'gunicorn -c setting.py app:app' |grep -v grep|awk '{print $2}'`
n=0
while [[ ! -f /etc/init.d/mw ]];
do
echo -e ".\c"
sleep 0.5
let n+=1
if [ $n -gt 15 ];then
break;
fi
done
echo -e "start mw success"
/etc/init.d/mw default