我在路由器上使用这个脚本,使用 Entware 每 15 分钟检查一次网站的响应。它只运行一次并在前 15 分钟后终止。为什么?
#! /bin/sh
for i in {1..10}
do
date >> webresp.csv
curl -w 'Testing Website Response Time for :%{url_effective}\n\nLookup Time:\t\t%{time_namelookup}\nConnect Time:\t\t%{time_connect}\nPre-transfer Time:\t%{time_pretransfer}\nStart-transfer Time:\t%{time_starttransfer}\n\nTotal Time:\t\t%{time_total}\n' -o /dev/null www.google.com | tee -a webresp.csv
sleep 900
done
Run Code Online (Sandbox Code Playgroud) shell-script ×1