diff --git a/hua_wei_yun/14yvan-workbench-app.sh b/hua_wei_yun/14yvan-workbench-app.sh index b387b3a..6494300 100644 --- a/hua_wei_yun/14yvan-workbench-app.sh +++ b/hua_wei_yun/14yvan-workbench-app.sh @@ -205,12 +205,28 @@ logs() { tail -F $logPath -n 100 } +startPcUi() { + pid=`ps -ef | grep "${codePath}/workbench-ui/node_modules/.bin/vite" | grep -v 'grep' | awk '{print $2}'` + if [ -z $pid ];then + echo "workbench-ui 未运行" + else + echo -e "$echoPrefix ps -ef | grep "${codePath}/workbench-ui/node_modules/.bin/vite" | grep -v 'grep' | awk '{print \$2}' | xargs kill $echoSuffix" + ps -ef | grep "${codePath}/workbench-ui/node_modules/.bin/vite" | grep -v 'grep' | awk '{print $2}' | xargs kill + echo "workbench-ui 已停止!" + sleep 3s + fi + echo -e "$echoPrefix cd $codePath/workbench-ui $echoSuffix" + cd "$codePath/workbench-ui" + 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}'` # 操作参数: pull deploy restart start stop kill log logs if [ "$cmd" == "pull" ];then deployPull if [ -z $pid ];then - echo "$serverName 未运行 | 输入操作参数: pull deploy restart start stop kill log logs" + echo "$serverName 未运行 | 输入操作参数: pull deploy restart start stop kill log logs startPc" fi elif [ "$cmd" == "deploy" ];then deployServer $pid @@ -222,6 +238,8 @@ elif [ "$cmd" == "stop" ] || [ "$cmd" == "kill" ];then stopServer $pid elif [ "$cmd" == "log" ] || [ "$cmd" == "logs" ];then logs +elif [ "$cmd" == "startPc" ];then + startPcUi else if [ -z $pid ];then echo "$serverName 未运行 | 输入操作参数: pull deploy restart start stop kill log logs"