-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupgrade.fedora.sh
executable file
·35 lines (31 loc) · 1.12 KB
/
upgrade.fedora.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
. /etc/os-release
if [ "$NAME" != "Fedora" ]; then
if [ "$NAME" != "Fedora Linux" ]; then
if [ "$ID" != "fedora" ]; then
echo "Error: ID=fedora or NAME=\"Fedora Linux\" (or older NAME=Fedora) was expected in /etc/os-release but ID is $ID and NAME is $NAME. This script is only for Fedora."
exit 1
fi
fi
fi
me=`basename $0`
NEXT_VER=$(($VERSION_ID+1))
cat <<END
[$me] This script does:
dnf upgrade --refresh -y && dnf install dnf-plugin-system-upgrade -y && dnf system-upgrade download -y --releasever=$1
# dnf system-upgrade reboot
END
if [ -z "$1" ]; then
echo "[$me] You must specify a version."
if [ ! -z "$VERSION_ID" ]; then
echo "[$me] You have $VERSION_ID so you should specify $NEXT_VER."
else
echo "[$me] Also, $VERSION_ID was expected in /etc/os-release but the variable wasn't present."
fi
exit 1
fi
dnf upgrade --refresh -y && dnf install dnf-plugin-system-upgrade -y && dnf system-upgrade download -y --releasever=$1
echo <<END
[$me] The following manual steps are necessary if everything worked so far:
dnf system-upgrade reboot
END