Update Auto.sh
This commit is contained in:
parent
c7bf77b3fa
commit
1636999636
18
Auto.sh
18
Auto.sh
@ -1,16 +1,14 @@
|
||||
#!/bin/bash
|
||||
while true; do
|
||||
# 检查node进程是否存在
|
||||
while true
|
||||
do
|
||||
ps -ef | grep "node" | grep -v "grep"
|
||||
if [ "$?" -eq 1 ]; then
|
||||
# 如果node进程不存在,输出信息并启动node
|
||||
echo "Node进程未运行,正在尝试重新启动..."
|
||||
if [ "$?" -eq 1 ]
|
||||
then
|
||||
echo "process has restarting..."
|
||||
GOEXPERIMENT=arenas go run ./...
|
||||
echo "Node进程已启动。"
|
||||
echo "process has been restarted!"
|
||||
else
|
||||
# 如果node进程正在运行,输出信息
|
||||
echo "Node进程已经在运行中。"
|
||||
echo "process already started!"
|
||||
fi
|
||||
# 每次检查后休眠10秒
|
||||
sleep 10
|
||||
done
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user