mirror of
https://github.com/nsnail/NetAdmin.git
synced 2025-06-20 18:58:16 +08:00
@ -9,8 +9,10 @@ fi
|
||||
# 获取外部传入的 URL 参数
|
||||
URL="$1"
|
||||
|
||||
# 初始化返回值
|
||||
# 初始化返回值和时间限制
|
||||
response=""
|
||||
start_time=$(date +%s)
|
||||
time_limit=600 # 10分钟的秒数
|
||||
|
||||
# 循环检查 API 返回值
|
||||
while [ "$response" != "1" ]; do
|
||||
@ -22,7 +24,16 @@ while [ "$response" != "1" ]; do
|
||||
|
||||
# 打印返回值 (可选)
|
||||
echo "$1: $response"
|
||||
|
||||
# 检查时间是否超过限制
|
||||
current_time=$(date +%s)
|
||||
elapsed_time=$((current_time - start_time))
|
||||
|
||||
if [ "$elapsed_time" -ge "$time_limit" ]; then
|
||||
echo "Time limit exceeded. Continuing with the script..."
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
# 当返回值为 "1" 时,继续执行后续脚本
|
||||
echo "API returned 1. Continuing with the script..."
|
||||
# 无论是因为返回值为 "1" 还是超时,继续执行后续脚本
|
||||
echo "Continuing with the script..."
|
Reference in New Issue
Block a user