mirror of
https://github.com/aclist/dztui.git
synced 2026-10-28 13:42:42 +01:00
fix: test connection control flow
This commit is contained in:
1 parent
a079d554bc
commit
7c5bd76e8f
1 file changed
+8
-4
@@ -874,14 +874,18 @@ test_connection(){
|
||||
["github.com"]="https://github.com/$author"
|
||||
["codeberg.org"]="https://codeberg.org/$author"
|
||||
)
|
||||
res=$(get_response_code "${hr["github.com"]}")
|
||||
[[ $res -ne 200 ]] && remote_host=cb
|
||||
res=$(get_response_code "${hr["codeberg.org"]}")
|
||||
[[ $res -ne 200 ]] && raise_error_and_quit "$str (${hr["codeberg.org"]})"
|
||||
# steam API is mandatory
|
||||
res=$(get_response_code "${hr["steampowered.com"]}")
|
||||
[[ $res -ne 200 ]] && raise_error_and_quit "$str ${hr["steampowered.com"]}"
|
||||
|
||||
res=$(get_response_code "${hr["github.com"]}")
|
||||
if [[ $res -ne 200 ]]; then
|
||||
logger WARN "Remote host '${hr["github.com"]}' unreachable', trying fallback"
|
||||
remote_host=cb
|
||||
res=$(get_response_code "${hr["codeberg.org"]}")
|
||||
[[ $res -ne 200 ]] && raise_error_and_quit "$str (${hr["codeberg.org"]})"
|
||||
fi
|
||||
|
||||
if [[ $remote_host == "cb" ]]; then
|
||||
url_prefix="https://codeberg.org/$author/$repo/raw/branch"
|
||||
releases_url="https://codeberg.org/$author/$repo/releases/download/browser"
|
||||
|
||||
Reference in new issue
Block a user