diff --git a/script.sh b/script.sh new file mode 100644 index 0000000..3e98645 --- /dev/null +++ b/script.sh @@ -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 \ No newline at end of file