1
0
Fork 0
mirror of https://github.com/aclist/dztui.git synced 2024-12-27 21:02:36 +01:00

fix: return codes

This commit is contained in:
aclist 2024-12-13 10:18:56 +09:00
parent 4da78d33f3
commit 3fce2cc3ad
2 changed files with 8 additions and 2 deletions

View file

@ -581,7 +581,7 @@ fetch_helpers_by_sum(){
["ui.py"]="be3da1e542d14105f4358dd38901e25a"
["query_v2.py"]="55d339ba02512ac69de288eb3be41067"
["vdf2json.py"]="2f49f6f5d3af919bebaab2e9c220f397"
["funcs"]="2a27ab36d5f8071fe53bf8dfd3b8d88d"
["funcs"]="10c7d9cb9fbb792626ec9e7a4a788ba5"
["lan"]="c62e84ddd1457b71a85ad21da662b9af"
)
local author="aclist"

View file

@ -843,7 +843,6 @@ test_connection(){
remote_host=cb
res=$(get_response_code "${hr["codeberg.org"]}")
if [[ $res -ne 200 ]]; then
printf "Failed to fetch new version. Rolling back"
return 1
fi
fi
@ -857,6 +856,12 @@ test_connection(){
}
download_new_version(){
test_connection
rc=$?
if [[ $rc -eq 1 ]]; then
printf "Remote resource unavailable. Aborting"
logger WARN "Remote resource unavailable"
return 1
fi
local version_url="$(format_version_url)"
mv "$src_path" "$src_path.old"
curl -Ls "$version_url" > "$src_path"
@ -896,6 +901,7 @@ toggle(){
fi
update_config
download_new_version
[[ $? -eq 1 ]] && return 1
return 255
;;
Toggle[[:space:]]mod[[:space:]]install[[:space:]]mode)