Files
workstation-config/install.sh
T
2026-04-24 12:08:38 +00:00

36 lines
984 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters
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.
#!/usr/bin/env bash
set -e
echo "🚀 Starte Bootstrap Installation..."
# 🧠 Konfiguration
GIT_REPO_SSH="ssh://git@192.168.178.5:2222/kai/workstation-config.git"
GIT_REPO_HTTP="http://192.168.178.5:3000/kai/workstation-config.git"
TARGET_DIR="$HOME/workstation-config"
# 🔍 Prüfen ob gültiges Repo
if git -C "$TARGET_DIR" rev-parse --is-inside-work-tree >/dev/null 2>&1; then
echo "🔄 Gültiges Repo gefunden update..."
git -C "$TARGET_DIR" pull
else
echo "⚠️ Kein gültiges Repo gefunden"
if [ -d "$TARGET_DIR" ]; then
echo "🧹 Entferne alten Ordner..."
rm -rf "$TARGET_DIR"
fi
echo "📥 Versuche SSH Clone..."
if git clone "$GIT_REPO_SSH" "$TARGET_DIR"; then
echo "✅ SSH Clone erfolgreich"
else
echo "⚠️ SSH fehlgeschlagen fallback auf HTTP"
git clone "$GIT_REPO_HTTP" "$TARGET_DIR"
fi
fi
echo "⚙️ Starte Installation..."
bash "$TARGET_DIR/temp-cleanup/install.sh"