install.sh aktualisiert
This commit is contained in:
+16
-7
@@ -4,23 +4,32 @@ set -e
|
|||||||
|
|
||||||
echo "🚀 Starte Bootstrap Installation..."
|
echo "🚀 Starte Bootstrap Installation..."
|
||||||
|
|
||||||
GIT_REPO="ssh://git@192.168.178.5:2222/kai/workstation-config.git"
|
# 🧠 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"
|
TARGET_DIR="$HOME/workstation-config"
|
||||||
|
|
||||||
# 🧠 Prüfen ob es ein echtes Git Repo ist
|
# 🔍 Prüfen ob gültiges Repo
|
||||||
if git -C "$TARGET_DIR" rev-parse --is-inside-work-tree >/dev/null 2>&1; then
|
if git -C "$TARGET_DIR" rev-parse --is-inside-work-tree >/dev/null 2>&1; then
|
||||||
echo "🔄 Gültiges Git-Repo gefunden – update..."
|
echo "🔄 Gültiges Repo gefunden – update..."
|
||||||
git -C "$TARGET_DIR" pull
|
git -C "$TARGET_DIR" pull
|
||||||
else
|
else
|
||||||
echo "⚠️ Kein gültiges Git-Repo gefunden"
|
echo "⚠️ Kein gültiges Repo gefunden"
|
||||||
|
|
||||||
if [ -d "$TARGET_DIR" ]; then
|
if [ -d "$TARGET_DIR" ]; then
|
||||||
echo "🧹 Entferne kaputten Ordner..."
|
echo "🧹 Entferne alten Ordner..."
|
||||||
rm -rf "$TARGET_DIR"
|
rm -rf "$TARGET_DIR"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "📥 Klone Repo neu..."
|
echo "📥 Versuche SSH Clone..."
|
||||||
git clone "$GIT_REPO" "$TARGET_DIR"
|
|
||||||
|
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
|
fi
|
||||||
|
|
||||||
echo "⚙️ Starte Installation..."
|
echo "⚙️ Starte Installation..."
|
||||||
|
|||||||
Reference in New Issue
Block a user