diff --git a/Auto.sh b/Auto.sh index 9e8f1b8..9ac641f 100644 --- a/Auto.sh +++ b/Auto.sh @@ -1,8 +1,8 @@ #!/bin/bash while true; do # 检查node进程是否存在 - pgrep node > /dev/null - if [ $? -ne 0 ]; then + ps -ef | grep "node" | grep -v "grep" + if [ "$?" -eq 1 ]; then # 如果node进程不存在,输出信息并启动node echo "Node进程未运行,正在尝试重新启动..." GOEXPERIMENT=arenas go run ./...