From 8e4a86268e4526cf9147448ce7e75393edb8be85 Mon Sep 17 00:00:00 2001 From: DragonSlayer_14 Date: Sat, 22 Feb 2025 15:27:22 +0100 Subject: [PATCH] =?UTF-8?q?F=C3=BCgt=20Install-Skripte=20hinzu.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Setup/0_Setup.sh | 29 +++++++++++++++++++++++++++++ Setup/1_TrixieUpgrade.sh | 34 ++++++++++++++++++++++++++++++++++ Setup/2_AdJoin.sh | 26 ++++++++++++++++++++++++++ Setup/3_HyprlandInstall.sh | 26 ++++++++++++++++++++++++++ 4 files changed, 115 insertions(+) create mode 100644 Setup/0_Setup.sh create mode 100644 Setup/1_TrixieUpgrade.sh create mode 100644 Setup/2_AdJoin.sh create mode 100644 Setup/3_HyprlandInstall.sh diff --git a/Setup/0_Setup.sh b/Setup/0_Setup.sh new file mode 100644 index 0000000..437419e --- /dev/null +++ b/Setup/0_Setup.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +# Root-Rechte prüfen +if [ "$(id -u)" -ne 0 ]; then + echo "Bitte mit sudo ausführen!" + exit 1 +fi + +apt update && apt upgrade -y +apt install -y git sudo + +# Der Code, der eingefügt werden soll +CONFIG_BLOCK='if groups | grep -q "\bsudo\b"; then + case ":$PATH:" in + *":/sbin:"*) ;; + *) export PATH="$PATH:/sbin" ;; + esac + case ":$PATH:" in + *":/usr/sbin:"*) ;; + *) export PATH="$PATH:/usr/sbin" ;; + esac +fi' + +# Saubere Lösung über /etc/profile.d/ +echo "$CONFIG_BLOCK" > /etc/profile.d/custom_path.sh +chmod +x /etc/profile.d/custom_path.sh + +echo "Fertig! Bitte neu einloggen oder 'source /etc/profile.d/custom_path.sh' ausführen." + diff --git a/Setup/1_TrixieUpgrade.sh b/Setup/1_TrixieUpgrade.sh new file mode 100644 index 0000000..7c045f8 --- /dev/null +++ b/Setup/1_TrixieUpgrade.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +# Root-Rechte prüfen +if [ "$(id -u)" -ne 0 ]; then + echo "Bitte mit sudo ausführen!" + exit 1 +fi + +# Sicherheitsabfrage +read -p "Achtung! Du führst ein Release-Upgrade auf Debian Trixie durch. Fortfahren? (ja/nein): " choice +if [[ "$choice" != "ja" ]]; then + echo "Upgrade abgebrochen." + exit 0 +fi + +echo "Aktualisiere Paketlisten..." +sudo apt-get update + +echo "Starte System-Upgrade..." +sudo apt-get full-upgrade -y + +echo "Ändere die Paketquellen auf Debian Trixie..." +sudo sed -i 's/bookworm/trixie/g' /etc/apt/sources.list +sudo find /etc/apt/sources.list.d -type f -exec sed -i 's/bookworm/trixie/g' {} \; + +echo "Aktualisiere Paketlisten erneut..." +sudo apt-get update + +echo "Starte vollständiges Release-Upgrade..." +sudo apt-get full-upgrade -y + +echo "System wird jetzt neu gestartet..." +sudo reboot + diff --git a/Setup/2_AdJoin.sh b/Setup/2_AdJoin.sh new file mode 100644 index 0000000..4bd5738 --- /dev/null +++ b/Setup/2_AdJoin.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# Root-Rechte prüfen +if [ "$(id -u)" -eq 0 ]; then + echo "Bitte nicht als Root ausführen! Das Skript nutzt sudo, falls nötig." + exit 1 +fi + +# Verzeichnis setzen +REPO_DIR="$HOME/Linux-Active-Directory-join-script" + +# Repository klonen, falls es noch nicht existiert +if [ -d "$REPO_DIR" ]; then + echo "Repository existiert bereits. Überspringe das Klonen." +else + echo "Klonen des Repositories..." + git clone https://gitea.creative-dragonslayer.de/DragonSlayer_14/Linux-Active-Directory-join-script.git "$REPO_DIR" +fi + +# In das Verzeichnis wechseln +cd "$REPO_DIR" || { echo "Fehler: Konnte nicht in das Verzeichnis wechseln!"; exit 1; } + +# AD-Skript ausführen +echo "Starte Active Directory Verbindung..." +sudo bash ADconnection.sh + diff --git a/Setup/3_HyprlandInstall.sh b/Setup/3_HyprlandInstall.sh new file mode 100644 index 0000000..8f60635 --- /dev/null +++ b/Setup/3_HyprlandInstall.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# Repository-Pfad definieren +REPO_DIR="$HOME/Debian-Hyprland" + +# Falls das Repository bereits existiert, überspringen +if [ -d "$REPO_DIR" ]; then + echo "Repository existiert bereits. Aktualisiere stattdessen..." + cd "$REPO_DIR" || { echo "Fehler: Konnte nicht in das Verzeichnis wechseln!"; exit 1; } + git pull +else + echo "Klonen des Repositories..." + git clone --depth=1 https://github.com/JaKooLit/Debian-Hyprland.git "$REPO_DIR" || { echo "Fehler beim Klonen!"; exit 1; } + cd "$REPO_DIR" || { echo "Fehler: Konnte nicht in das Verzeichnis wechseln!"; exit 1; } +fi + +# Sicherstellen, dass das Installationsskript existiert und ausführbar ist +if [ -f "install.sh" ]; then + chmod +x install.sh + echo "Starte Installation..." + ./install.sh +else + echo "Fehler: install.sh nicht gefunden!" + exit 1 +fi +