From 383a7c707845145391f6b8fdaeb52c86b439b799 Mon Sep 17 00:00:00 2001 From: felix Date: Mon, 4 May 2026 14:06:29 +0200 Subject: [PATCH] =?UTF-8?q?install.sh=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 install.sh diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..730ed8a --- /dev/null +++ b/install.sh @@ -0,0 +1,89 @@ +#!/bin/bash + +# Farben für eine übersichtliche Ausgabe +GREEN='\033[0;32m' +BLUE='\033[0;34m' +YELLOW='\033[1;33m' +RED='\033[0;31m' +NC='\033[0m' # No Color + +echo -e "${BLUE}==========================================" +echo -e " Ultimate Setup Script 2026" +echo -e "==========================================${NC}" + +# 1. System Update & Upgrade +echo -e "${YELLOW}Schritt 1: System-Vorbereitung${NC}" +read -p "Möchtest du ein apt-update & apt-upgrade durchführen? (j/n): " do_upgrade +if [[ $do_upgrade =~ ^[Jj]$ ]]; then + echo -e "${GREEN}Aktualisiere System...${NC}" + sudo apt-get update && sudo apt-get upgrade -y +else + echo -e "Update übersprungen." +fi + +# 2. Software-Liste +options=( + "Docker" + "Node.js" + "Python3 & Pip" + "Git" + "VS Code" + "Midnight Commander (mc)" + "sudo" + "curl" + "MariaDB (MySQL)" + "Beenden" +) + +show_menu() { + echo -e "\n${BLUE}Wähle die Software zur Installation (Zahlen mit Leerzeichen trennen):${NC}" + for i in "${!options[@]}"; do + printf "%2d) %s\n" "$((i+1))" "${options[$i]}" + done +} + +# Installations-Funktionen +install_mariadb() { + echo -e "${GREEN}Installiere MariaDB Server...${NC}" + sudo apt-get update + sudo apt-get install -y mariadb-server + echo -e "${YELLOW}Starte MariaDB-Dienst...${NC}" + sudo systemctl start mariadb + sudo systemctl enable mariadb + echo -e "${BLUE}Tipp: Führe nach dem Skript 'sudo mysql_secure_installation' aus, um ein Passwort zu setzen.${NC}" +} + +install_docker() { + echo -e "${GREEN}Installiere Docker...${NC}" + sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common + curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null + sudo apt-get update && sudo apt-get install -y docker-ce docker-ce-cli containerd.io +} + +# 3. Haupt-Logik +show_menu +read -p "Deine Auswahl: " choices + +for choice in $choices; do + case $choice in + 1) install_docker ;; + 2) echo -e "${GREEN}Installiere Node.js...${NC}"; curl -fsSL https://deb.nodesource.com/setup_current.x | sudo -E bash -; sudo apt-get install -y nodejs ;; + 3) echo -e "${GREEN}Installiere Python3...${NC}"; sudo apt-get install -y python3 python3-pip ;; + 4) echo -e "${GREEN}Installiere Git...${NC}"; sudo apt-get install -y git ;; + 5) # VS Code Logik verkürzt für Übersicht + wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | sudo tee /etc/apt/keyrings/vscode.gpg > /dev/null + echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/vscode.gpg] https://packages.microsoft.com/repos/code stable main" | sudo tee /etc/apt/sources.list.d/vscode.list + sudo apt-get update && sudo apt-get install -y code ;; + 6) sudo apt-get install -y mc ;; + 7) sudo apt-get install -y sudo ;; + 8) sudo apt-get install -y curl ;; + 9) install_mariadb ;; + 10) exit 0 ;; + *) echo -e "${RED}Ungültige Option: $choice${NC}" ;; + esac +done + +echo -e "\n${GREEN}==========================================" +echo -e " Installation abgeschlossen!" +echo -e "==========================================${NC}" \ No newline at end of file