Quilibrium/Auto.sh
2024-03-02 14:32:08 +08:00

17 lines
508 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
while true; do
# 检查node进程是否存在
ps -ef | grep "node" | grep -v "grep"
if [ "$?" -eq 1 ]; then
# 如果node进程不存在输出信息并启动node
echo "Node进程未运行正在尝试重新启动..."
GOEXPERIMENT=arenas go run ./...
echo "Node进程已启动。"
else
# 如果node进程正在运行输出信息
echo "Node进程已经在运行中。"
fi
# 每次检查后休眠10秒
sleep 10
done