From 32835e6b52a242bc4f5162f8c9af4401f8d9d99a Mon Sep 17 00:00:00 2001 From: Sapphirus Date: Thu, 13 Apr 2023 04:57:01 +0000 Subject: [PATCH] Change version_next to global var VERSION_NEXT --- fedora_upgrade | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fedora_upgrade b/fedora_upgrade index d0c1789..4f73fff 100644 --- a/fedora_upgrade +++ b/fedora_upgrade @@ -2,6 +2,7 @@ source /etc/os-release MIRROR="https://mirror.xenyth.net/fedora/linux/releases" +VERSION_NEXT=$(($VERSION_ID + 1)) main () { curl -s -o /dev/null $MIRROR @@ -13,7 +14,6 @@ main () { return fi - local version_next=$(($VERSION_ID + 1)) local mirror_response=$(curl -s -o /dev/null -w "%{http_code}" $MIRROR/$version_next/) if [[ $mirror_response == 404 ]]; then @@ -22,13 +22,13 @@ main () { fi dnf upgrade --refresh -y - dnf system-upgrade download --releasever=$version_next -y + dnf system-upgrade download --releasever=$VERSION_NEXT -y - wall "WARNING: An upgrade from Fedora $VERSION_ID to Fedora $version_next is commencing! Your computer will reboot in 60 seconds." + wall "WARNING: An upgrade from Fedora $VERSION_ID to Fedora $VERSION_NEXT is commencing! Your computer will reboot in 60 seconds." sleep 60 dnf system-upgrade reboot -y } -main +main \ No newline at end of file