Last active
January 9, 2019 01:08
-
-
Save dhilst/019b73a46e975239083d3acd71361ac9 to your computer and use it in GitHub Desktop.
Fedora Update
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Update Fedora | |
is_number() { perl -se 'exit($n !~ /^\d+(\.\d+)?$/)' -- -n="$1"; } | |
current_version=$(curl -s https://sjc.edge.kernel.org/fedora-buffet/fedora/linux/releases/ | perl -lane 'print $1 if /href="(\d+)\/"/' | sort -rn | head -1) | |
is_number $current_version || { echo 'Cant get Fedora version'; exit 1; } | |
dnf install dnf-plugin-system-upgrade -y && dnf upgrade --refresh -y && dnf system-upgrade download --refresh --releasever=$current_version -y && dnf system-upgrade reboot -y |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment