1
0

Code cleanup

- Split up into two functions
- Rename main to check
This commit is contained in:
Xavier Moffett 2023-04-13 05:00:20 +00:00
parent 32835e6b52
commit 6024df6d52

View File

@ -4,13 +4,13 @@ source /etc/os-release
MIRROR="https://mirror.xenyth.net/fedora/linux/releases"
VERSION_NEXT=$(($VERSION_ID + 1))
main () {
check () {
curl -s -o /dev/null $MIRROR
if [[ $? != 0 ]]; then
echo "Internet connection not found, or mirror is offline. Trying again in 60 seconds.."
sleep 60
main
check
return
fi
@ -21,6 +21,10 @@ main () {
return
fi
upgrade
}
upgrade () {
dnf upgrade --refresh -y
dnf system-upgrade download --releasever=$VERSION_NEXT -y
@ -31,4 +35,4 @@ main () {
dnf system-upgrade reboot -y
}
main
check