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/)
|
local mirror_response=$(curl -s -o /dev/null -w "%{http_code}" $MIRROR/$VERSION_NEXT/)
|
||||||
|
|
||||||
if [[ $mirror_response == 404 ]]; then
|
case $mirror_response in
|
||||||
echo "Fedora $VERSION_ID is the latest version."
|
404)
|
||||||
return
|
echo "Fedora $VERSION_ID is the latest version."
|
||||||
fi
|
;;
|
||||||
|
200)
|
||||||
upgrade
|
upgrade
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Mirror returned unhandled HTTP Response Code: $mirror_response."
|
||||||
|
;;
|
||||||
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
upgrade () {
|
upgrade () {
|
||||||
|
|
Loading…
Reference in a new issue