From 75083423798e56d7ef96d9cf4ede57eea4b9b18c Mon Sep 17 00:00:00 2001 From: lizw <1183409807@qq.com> Date: Wed, 12 Apr 2023 12:05:55 +0800 Subject: [PATCH] 04wms-ztf-test.sh --- hua_wei_yun/04wms-ztf-test.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/hua_wei_yun/04wms-ztf-test.sh b/hua_wei_yun/04wms-ztf-test.sh index 8add76d..5f3f66a 100644 --- a/hua_wei_yun/04wms-ztf-test.sh +++ b/hua_wei_yun/04wms-ztf-test.sh @@ -223,11 +223,19 @@ startPcUi() { } startMobileUi() { + pid=`ps -ef | grep "${codePath}/wms-ui-mobile/node_modules/.bin/vite" | grep -v 'grep' | awk '{print $2}'` + if [ -z $pid ];then + echo "wms-ui-mobile 未运行" + else + echo -e "$echoPrefix ps -ef | grep "${codePath}/wms-ui-mobile/node_modules/.bin/vite" | grep -v 'grep' | awk '{print \$2}' | xargs kill $echoSuffix" + ps -ef | grep "${codePath}/wms-ui-mobile/node_modules/.bin/vite" | grep -v 'grep' | awk '{print $2}' | xargs kill + echo "wms-ui-mobile 已停止!" + sleep 3s + fi echo -e "$echoPrefix cd $codePath/wms-ui-mobile $echoSuffix" cd "$codePath/wms-ui-mobile" - - - + echo -e "$echoPrefix nohup yarn run dev >>/dev/null 2>&1 & $echoSuffix" + nohup yarn run dev >>/dev/null 2>&1 & } pid=`ps -ef | grep "DappName=${serverName}" | grep -v 'grep' | awk '{print $2}'` @@ -246,6 +254,8 @@ elif [ "$cmd" == "build" ];then elif [ "$cmd" == "deploy" ];then deployYvanUI deployServer $pid + startPcUi + startMobileUi elif [ "$cmd" == "restart" ];then restartServer $pid elif [ "$cmd" == "start" ];then