1
0
Fork 0

Handle edge case with unexpected HTTP response

This commit is contained in:
Xavier Moffett 2023-04-13 11:07:15 +00:00
parent 0c79e3ab9a
commit 0fa463d064

View file

@ -16,12 +16,17 @@ check () {
local mirror_response=$(curl -s -o /dev/null -w "%{http_code}" $MIRROR/$VERSION_NEXT/)
if [[ $mirror_response == 404 ]]; then
echo "Fedora $VERSION_ID is the latest version."
return
fi
upgrade
case $mirror_response in
404)
echo "Fedora $VERSION_ID is the latest version."
;;
200)
upgrade
;;
*)
echo "Mirror returned unhandled HTTP Response Code: $mirror_response."
;;
esac
}
upgrade () {