mirror of
https://github.com/aclist/dztui.git
synced 2025-04-03 19:13:00 +02:00
fix: test connection control flow
This commit is contained in:
parent
a079d554bc
commit
7c5bd76e8f
1 changed files with 8 additions and 4 deletions
12
dzgui.sh
12
dzgui.sh
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue