From 52a27f3325744a19949f70d1ec571685462c8334 Mon Sep 17 00:00:00 2001 From: jonas H Date: Tue, 25 Aug 2026 21:44:25 +0200 Subject: [PATCH] add start of isntll script --- installer/installer.py | 0 installer/join.sh | 93 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 installer/installer.py create mode 100644 installer/join.sh diff --git a/installer/installer.py b/installer/installer.py new file mode 100644 index 0000000..e69de29 diff --git a/installer/join.sh b/installer/join.sh new file mode 100644 index 0000000..5b9239d --- /dev/null +++ b/installer/join.sh @@ -0,0 +1,93 @@ +#!/usr/bin/env bash + +set -u + +# Python bereits vorhanden? +if command -v python3 >/dev/null 2>&1; then + echo "Python ist bereits installiert:" + python3 --version + exit 0 +fi + +echo "Python 3 wurde nicht gefunden." + +# OS erkennen +if [[ -f /etc/os-release ]]; then + . /etc/os-release +else + echo "Konnte das Betriebssystem nicht erkennen." + exit 1 +fi + +# Paketmanager bestimmen +case "$ID" in + debian|ubuntu|linuxmint|pop) + PKG_MANAGER="apt" + INSTALL_CMD="sudo apt install --yes python3" + ;; + arch|manjaro|endeavouros) + PKG_MANAGER="pacman" + INSTALL_CMD="sudo pacman -S --noconfirm python" + ;; + fedora) + PKG_MANAGER="dnf" + INSTALL_CMD="sudo dnf install -y python3" + ;; + rhel|centos|rocky|almalinux) + PKG_MANAGER="dnf" + INSTALL_CMD="sudo dnf install -y python3" + ;; + opensuse*|sles) + PKG_MANAGER="zypper" + INSTALL_CMD="sudo zypper --non-interactive install python3" + ;; + alpine) + PKG_MANAGER="apk" + INSTALL_CMD="sudo apk add python3" + ;; + void) + PKG_MANAGER="xbps-install" + INSTALL_CMD="sudo xbps-install -Sy python3" + ;; + gentoo) + PKG_MANAGER="emerge" + INSTALL_CMD="sudo emerge dev-lang/python" + ;; + *) + echo "Unbekanntes Betriebssystem:" + echo " $PRETTY_NAME" + echo " ID=$ID" + exit 1 + ;; +esac + +echo +echo "OS: $PRETTY_NAME" +echo "Paketmanager: $PKG_MANAGER" +echo "Installation: $INSTALL_CMD" +echo + +read -r -p "Python 3 jetzt installieren? [j/N] " answer + +case "$answer" in + j|J|ja|Ja|JA) + echo + echo "Installiere Python 3..." + eval "$INSTALL_CMD" + ;; + *) + echo "Installation abgebrochen." + exit 0 + ;; +esac + +# Prüfen, ob Installation erfolgreich war +if command -v python3 >/dev/null 2>&1; then + echo + echo "Python wurde erfolgreich installiert:" + python3 --version +else + echo + echo "Python konnte nicht gefunden werden. Die Installation ist möglicherweise fehlgeschlagen." + exit 1 +fi