From dd5070b37475b53a026e32e789bbb10c05ed3f87 Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Thu, 12 Oct 2023 23:04:20 +0900 Subject: [PATCH] updated script --- install.sh | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/install.sh b/install.sh index e94f47e..4f0d7f3 100755 --- a/install.sh +++ b/install.sh @@ -132,21 +132,30 @@ printf "\n" # Ensuring all in the scripts folder are made executable chmod +x install-scripts/* - # enabling deb-src in /etc/apt/sources.list # Path to the sources.list file sources_list="/etc/apt/sources.list" -# Check if deb-src lines exist in the sources.list file -if grep -q "^deb-src" "$sources_list"; then - echo "deb-src lines already exist in $sources_list." +# Check if any lines starting with "# deb-src" exist +if grep -q "^# deb-src" "$sources_list"; then + echo "Found lines starting with '# deb-src' in $sources_list." else - # Add deb-src lines if they don't exist - echo "deb-src lines not found in $sources_list. Adding one..." - sudo sed -i '/^deb /s/^/#/' "$sources_list" - sudo sed -i '/^# deb-src/ s/^# //' "$sources_list" + # Remove the '#' from the first line starting with '#deb-src' + echo "No lines starting with '# deb-src' found in $sources_list. Removing '#' from the first such line..." + sudo sed -i '0,/^#deb-src/ s/^# //' "$sources_list" fi +# Check if any lines starting with "deb" exist +if grep -q "^deb" "$sources_list"; then + echo "Found lines starting with 'deb' in $sources_list." +else + # Remove the '#' from lines starting with '# deb' + echo "No lines starting with 'deb' found in $sources_list. Removing '#' from lines starting with '# deb'..." + sudo sed -i '/^# deb/ s/^# //' "$sources_list" +fi + +sudo apt update + # Install hyprland packages execute_script "00-dependencies.sh" execute_script "00-hypr-pkgs.sh"