serverPostInstall/script.sh
2024-08-03 13:02:52 +02:00

24 lines
No EOL
473 B
Bash

#!/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