Update run-all-speedtests.sh

This commit is contained in:
2023-05-21 22:28:50 -05:00
parent 10acd5646e
commit 7e3e682c10

View File

@@ -8,10 +8,15 @@ else
source /dev/stdin <<< "$(curl -sL http://go.scity.us/defaultinc)"
fi
echo "HERE: ${1}-${2}"
echo
echo -e "${idsCL[LightGreen]}Run All Local Speedtests${idsCL[Default]}"
if [ "${1}" == "" ]
echo -e "${idsCL[LightGreen]}Run All Local Speedtests${idsCL[Default]}"
local_servers=$(speedtest -L)
test_servers=(${local_servers//$'\n'/ })
else
echo -e "${idsCL[LightGreen]}Run Speedtests on '${1}'${idsCL[Default]}"
IFS=,; test_servers=(${1}); unset IFS
fi
echo
echo -en "${idsCL[LightCyan]}Do you wish to continue (y/N)?${idsCL[Default]}"
read -n 1 continue
@@ -19,9 +24,7 @@ echo
echo
case $continue in
[Yy])
local_servers=$(speedtest -L)
local_servers=(${local_servers//$'\n'/ })
for serverID in ${local_servers[@]}; do
for serverID in ${test_servers[@]}; do
sid='^[[:digit:]]{4,6}$'
[[ ${serverID} =~ ${sid} ]] && echo -e "${idsCL[Green]}Running on '${serverID}'${idsCL[Default]}" && echo 'YES' # && speedtest -s ${serverID}
done