Handle edge case with unexpected HTTP response
This commit is contained in:
parent
0c79e3ab9a
commit
0fa463d064
1 changed files with 11 additions and 6 deletions
|
@ -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 () {
|
||||
|
|
Loading…
Reference in a new issue