Setup/2_AdJoin.sh

32 lines
920 B
Bash
Executable File
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/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="/tmp/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
if [ -f "ADconnection.sh" ]; then
chmod +x ADconnection.sh
echo " Starte Active Directory setup..."
./ADconnection.sh
else
echo "❌ Fehler: ADconnection.sh nicht gefunden!"
exit 1
fi