refactor: make zsync_get() consistent with other checks

This commit is contained in:
Martin Wimpress 2024-05-03 18:50:03 +01:00 committed by Martin Wimpress
parent 2e1b556b93
commit 04b37ccf02
1 changed files with 4 additions and 7 deletions

View File

@ -1290,6 +1290,7 @@ function web_check() {
}
function zsync_get() {
local CHECK=""
local DIR="${2}"
local FILE="${1##*/}"
local OUT=""
@ -1299,13 +1300,9 @@ function zsync_get() {
test_result "${OS}" "${RELEASE}" "${EDITION}" "${URL}"
exit 0
elif [ "${OPERATION}" == "test" ]; then
if ! web_check "${URL}"; then
test_result "${OS}" "${RELEASE}" "${EDITION}" "${URL}" "FAIL"
exit 0
else
test_result "${OS}" "${RELEASE}" "${EDITION}" "${URL}" "PASS"
exit 0
fi
CHECK=$(web_check "${URL}" && echo 'PASS' || echo 'FAIL')
test_result "${OS}" "${RELEASE}" "${EDITION}" "${URL}" "${CHECK}"
exit 0
elif command -v zsync &>/dev/null; then
if [ -n "${3}" ]; then
OUT="${3}"