#!/bin/bash duration=$((30)) # 总持续时间,单位为秒 interval=1 # 循环间隔,单位为秒 iterations=$((duration / interval)) # 循环次数 server_status_fd_path="/app/SERVER_STATUS_FD" if [ ! -f "$server_status_fd_path" ]; then touch "$server_status_fd_path" echo "文件已创建" fi pid=$(ps -ef | grep wishpal-ironfan | grep -v grep | awk -F " " '{print $2}') echo $pid kill -2 $pid systemctl stop wishpal-ironfan # 循环执行 for ((i=0; i