Simple Linux Panel
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mdserver-web/scripts/update/ubuntu.sh

59 lines
1.2 KiB

3 years ago
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
3 years ago
export PATH
3 years ago
LANG=en_US.UTF-8
3 years ago
if grep -Eq "Ubuntu" /etc/*-release; then
sudo ln -sf /bin/bash /bin/sh
#sudo dpkg-reconfigure dash
fi
3 years ago
3 years ago
3 years ago
cd /www/server/mdserver-web/scripts && bash lib.sh
3 years ago
chmod 755 /www/server/mdserver-web/data
3 years ago
3 years ago
if [ -f /etc/init.d/mw ];then
sh /etc/init.d/mw stop && rm -rf /www/server/mdserver-web/scripts/init.d/mw && rm -rf /etc/init.d/mw
fi
3 years ago
echo -e "stop mw"
isStart=`ps -ef|grep 'gunicorn -c setting.py app:app' |grep -v grep|awk '{print $2}'`
3 years ago
port=7200
if [ -f /www/server/mdserver-web/data/port.pl ];then
port=$(cat /www/server/mdserver-web/data/port.pl)
fi
3 years ago
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
3 years ago
3 years ago
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"
3 years ago
3 years ago
systemctl daemon-reload
3 years ago
/etc/init.d/mw default
3 years ago