diff --git a/CHANGELOGS.md b/CHANGELOGS.md index 774c68d..43d3279 100644 --- a/CHANGELOGS.md +++ b/CHANGELOGS.md @@ -1,5 +1,8 @@ ## Changelogs +## 04 Sep 2024 +- added a function to check if it is Ubuntu or Based on Ubuntu and script will exit + ## 28 Aug 2024 - Added final check if hyprland is installed and will give an error to user diff --git a/install.sh b/install.sh index 490b979..2d45411 100755 --- a/install.sh +++ b/install.sh @@ -10,28 +10,48 @@ fi clear -printf "\n%.0s" {1..3} +# Function to check if the system is Ubuntu +is_ubuntu() { + # Check for 'Ubuntu' in /etc/os-release + if grep -q 'Ubuntu' /etc/os-release; then + return 0 + fi + return 1 +} + +# Check if the system is Ubuntu +if is_ubuntu; then + echo "This script is NOT intended for Ubuntu / Ubuntu Based. Please read the README for the correct link." + exit 1 +fi + +clear + +# ASCII art +printf "\n%.0s" {1..3} echo " | _. |/ _ _ | o _|_ " echo " \_| (_| o |\ (_) (_) |_ | |_ " -printf "\n%.0s" {1..2} +printf "\n%.0s" {1..2} # Welcome message echo "$(tput setaf 6)Welcome to JaKooLit's Debian Trixie/SID Hyprland Install Script!$(tput sgr0)" echo -echo "$(tput setaf 166)ATTENTION: Run a full system update and Reboot first!! (Highly Recommended) $(tput sgr0)" +echo "$(tput setaf 166)ATTENTION: Run a full system update and reboot first!! (Highly Recommended)$(tput sgr0)" echo -echo "$(tput setaf 3)NOTE: You will be required to answer some questions during the installation! $(tput sgr0)" +echo "$(tput setaf 3)NOTE: You will be required to answer some questions during the installation!$(tput sgr0)" echo -echo "$(tput setaf 3)NOTE: If you are installing on a VM, ensure to enable 3D acceleration else Hyprland wont start! $(tput sgr0)" +echo "$(tput setaf 3)NOTE: If you are installing on a VM, ensure to enable 3D acceleration; otherwise, Hyprland won't start!$(tput sgr0)" echo +# Prompt user to proceed read -p "$(tput setaf 6)Would you like to proceed? (y/n): $(tput sgr0)" proceed -if [ "$proceed" != "y" ]; then +if [[ "$proceed" != "y" ]]; then echo "Installation aborted." exit 1 fi + read -p "$(tput setaf 6)Have you edited your /etc/apt/sources.list? [Very Important] (y/n): $(tput sgr0)" proceed2 if [ "$proceed2" != "y" ]; then