diff --git a/ReleaseUpgradeALL.sh b/ReleaseUpgradeALL.sh index 67423ce..759fbd1 100755 --- a/ReleaseUpgradeALL.sh +++ b/ReleaseUpgradeALL.sh @@ -29,14 +29,17 @@ while true; do [Dd]* ) DoDebianReleaseUpdate=true DoAlpineReleaseUpdate=false + DoFedoraReleaseUpdate=false break;; [Aa]* ) DoDebianReleaseUpdate=false DoAlpineReleaseUpdate=true + DoFedoraReleaseUpdate=false break;; [Bb]* ) DoDebianReleaseUpdate=true DoAlpineReleaseUpdate=true + DoFedoraReleaseUpdate=false break;; * ) echo "Please answer with (D)Debian, (A)Alpine or (B)oth.";; esac @@ -73,6 +76,21 @@ echo "Enter the Alpine version to upgrade to" esac done fi +if $DoFedoraReleaseUpdate; then +echo "Enter the Fedora version to upgrade to" + read NewFedoraVersionNewFedoraVersion + while true; do + read -p "Upgrade to Fedora $NewFedoraVersion, is this correct? -> yes/no?" yn + case $yn in + [Nn]* ) + echo "Enter the Fedora version to upgrade to" + read NewFedoraVersion + ;; + [Yy]* ) break;; + * ) echo "Choose yes or no.";; + esac + done +fi #CT updates if $UpdateCT; then diff --git a/ReleaseUpgradeOne.sh b/ReleaseUpgradeOne.sh index 6fee1ac..250d5f5 100644 --- a/ReleaseUpgradeOne.sh +++ b/ReleaseUpgradeOne.sh @@ -82,9 +82,29 @@ elif [[ "${DIST}" == *"alpine"* ]]; then * ) echo "Choose yes or no.";; esac done +elif [[ "${DIST}" == *"fedora"* ]]; then + #Ask the wanted Fedora version + DoDebianReleaseUpdate=true + DoAlpineReleaseUpdate=true + DoFedoraReleaseUpdate=false + + echo "Enter the Fedora version to upgrade to" + read NewFedoraVersionNewFedoraVersion + while true; do + read -p "Upgrade to Fedora $NewFedoraVersion, is this correct? -> yes/no?" yn + case $yn in + [Nn]* ) + echo "Enter the Fedora version to upgrade to" + read NewFedoraVersion + ;; + [Yy]* ) break;; + * ) echo "Choose yes or no.";; + esac + done else echo "Warning: Release upgrade are supported for this distro" exit fi + $TYPE-UpgradeRelease $ID \ No newline at end of file diff --git a/functions.sh b/functions.sh index cd06f31..cec6b32 100644 --- a/functions.sh +++ b/functions.sh @@ -57,7 +57,7 @@ UpdatePackages () { elif [[ "${DIST}" == *"alpine"* ]]; then $INSTCALL -- apk update $INSTCALL -- apk upgrade - elif [[ "${DIST}" == *"centos"* ]]; then + elif [[ "${DIST}" == *"centos"* ]] || [[ "${DIST}" == *"fedora"* ]]; then $INSTCALL -- dnf update -y else echo "Warning: Package manager in not supported" @@ -202,8 +202,29 @@ UpgradeRelease () { else echo "Notice: Skiped, already up-to-date" fi - elif [[ "${DIST}" == *"alpine"* ]]; then - echo "Notice: Release upgrade disabled for Alpine" + elif [[ "${DIST}" == *"fedora"* ]]; then + echo "Notice: Release upgrade disabled for Fedora" + elif [[ "${DIST}" == *"alpine"* ]] && $DoFedoraReleaseUpdate ; then + if [ $RELVERSION != $NewFedoraVersion ]; then + #Create snapshot before upgrading + $SNAPSHOTCMD "Before upgrade form Fedora $RELVERSION to Fedora $NewFedoraVersion" + #Fully update current version + $INSTCALL -- dnf install dnf-plugin-system-upgrade remove-retired-packages symlinks clean-rpm-gpg-pubkey -y + $INSTCALL -- dnf upgrade --refresh -y + $INSTCALL -- system-upgrade download --releasever=$RELVERSION -y + $INSTCALL -- system-upgrade reboot + echo waiting 5 minutes for Fedora to install its update while rebooting + sleep 300 + $INSTCALL -- dnf remove --duplicates -y + $INSTCALL -- dnf autoremove -y + $INSTCALL -- clean-rpm-gpg-pubkey + $INSTCALL -- symlinks -r -d /usr + DOREBOOT=true + else + echo "Notice: Skiped, already up-to-date" + fi + elif [[ "${DIST}" == *"fedora"* ]]; then + echo "Notice: Release upgrade disabled for Fedora" else echo "Warning: Release upgrade are supported for this distro" #exit 100