Update Distro

This commit is contained in:
joeri 2024-08-03 13:02:52 +02:00
parent 3b852c17b6
commit 1202f32d9a

24
script.sh Normal file
View file

@ -0,0 +1,24 @@
#!/bin/bash
# Check the Linux distro
distro=$(cat /etc/os-release | grep ^NAME | cut -d '=' -f2- | sed 's/"//g')
# Update the OS
case $distro in
"Ubuntu" | "Linux Mint")
sudo apt update && sudo apt upgrade -y
;;
"Fedora" | "CentOS" | "RHEL")
sudo dnf update -y
;;
"openSUSE")
sudo zypper update -y
;;
"Debian")
sudo apt update && sudo apt upgrade -y
;;
*)
echo "Unsupported Linux distribution: $distro"
exit 1
;;
esac