From 8cca9eac5f1474ed7373af463acddc7be7e33c10 Mon Sep 17 00:00:00 2001 From: Marcus Date: Mon, 12 Jun 2023 21:43:31 +0200 Subject: [PATCH] changes --- setup.sh | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/setup.sh b/setup.sh index 472a0ff..209fc53 100644 --- a/setup.sh +++ b/setup.sh @@ -60,33 +60,36 @@ then fi message "Continue with installation..." - +message "check sources.list" +if ! grep "contrib" /etc/apt/sources.list > /dev/null && grep "non-free" /etc/apt/sources.list > /dev/null +then + message error "please activate 'contrib' and 'non-free' in your sources.ist" + exit 1 +fi # iterate through $packages for categorie in $package_categories do - message "Packages category: ${YELLOW}${i}${ENDCOLOR}" + message "Packages category: ${YELLOW}${categorie}${ENDCOLOR}" message "Packages contained: " - message "${GREEN}${packages[$i]}${ENDCOLOR}" + message "${GREEN}${packages[$categorie]}${ENDCOLOR}" + message "running pre-tasks" # pre installation steps for categories case $categorie in - base) - if ! grep "contrib" /etc/apt/sources.list && grep "non-free" /etc/apt/sources.list - then - message error "please activate 'contrib' and 'non-free' in your sources.ist" - exit 1 - fi - ;; nice) - sudo dpkg --add-architecture i386 - sudo apt update + sudo dpkg --add-architecture i386 || error + sudo apt update || error ;; esac + message "installing packages" + sudo apt install -y ${packages[$categorie]} || error + + message "running post-tasks" # post installation steps for categories case $categorie in base) - + flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo ;; esac