Commit 8a5ca8ef authored by Roland Singer's avatar Roland Singer

fallback to random generation method as soon as no rank mirrors have been found

parent f8fdb6b8
......@@ -78,6 +78,7 @@ rankmirrors() {
# Get all servers
local timesarray=()
local noservers="true"
for file in "$MirrorlistsDir"/*
do
......@@ -114,10 +115,21 @@ rankmirrors() {
# Add to list
timesarray+=("$time|$territory|$server")
noservers="false"
fi
done < "$file"
done
# Check if no servers have been found
if [ "$Method" == "rank" ] && [ "$noservers" == "true" ]; then
# Fall back to random generation method
echo ""
echo ":: No Servers found! Falling back to random generation method."
Method="random"
rankmirrors
return
fi
# Sort
timesarray=($(printf '%s\n' "${timesarray[@]}"|sort))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment