Silence the kernel.org timeout check and only compare the 502 check against head -n 1

This commit is contained in:
Tk-Glitch
2024-03-28 18:16:52 +01:00
parent 8f85fbc12f
commit 41fe1044da

View File

@@ -23,7 +23,7 @@ fi
if [[ -z "$_git_mirror" ]]; then
_git_mirror="${_git_remote_names[2]}"
if $( ! timeout 5 git ls-remote ${_kernel_git_remotes[$_git_mirror]} ) || [[ "$( git ls-remote ${_kernel_git_remotes[$_git_mirror]} )" = *502* ]]; then
if $( ! timeout 5 git ls-remote ${_kernel_git_remotes[$_git_mirror]} >/dev/null ) || [[ "$( git ls-remote ${_kernel_git_remotes[$_git_mirror]} | head -n 1 )" = *502* ]]; then
warning "kernel.org unreachable or too long to respond"
_git_mirror="${_git_remote_names[0]}"
fi