diff --git a/install.sh b/install.sh index 10876d9..c7847ff 100644 --- a/install.sh +++ b/install.sh @@ -4,51 +4,20 @@ set -e echo "🚀 Starte Bootstrap Installation..." -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" +cd /tmp -TARGET_DIR="$HOME/workstation-config" +REPO_URL_HTTP="http://192.168.178.5:3000/kai/workstation-config.git" +TARGET="$HOME/workstation-config" -# 📥 Repo sicherstellen -if ! git -C "$TARGET_DIR" rev-parse --is-inside-work-tree >/dev/null 2>&1; then - - echo "📥 Klone Repo..." - - if ! git clone "$GIT_REPO_SSH" "$TARGET_DIR"; then - echo "⚠️ SSH failed → HTTP fallback" - git clone "$GIT_REPO_HTTP" "$TARGET_DIR" - fi +if [ -d "$TARGET/.git" ]; then + echo "🔄 Repo update..." + git -C "$TARGET" pull else - echo "🔄 Repo vorhanden → update" - git -C "$TARGET_DIR" pull + echo "📥 Klone Repo..." + git clone "$REPO_URL_HTTP" "$TARGET" fi -cd "$TARGET_DIR/temp-cleanup" +echo "📦 Starte Modul Installation..." -echo "📦 Installiere Temp Cleanup System..." - -SYSTEMD_USER_DIR="$HOME/.config/systemd/user" -mkdir -p "$SYSTEMD_USER_DIR" - -SERVICE_FILE="systemd/cleanup-temp.service" -TIMER_FILE="systemd/cleanup-temp.timer" -SCRIPT_FILE="cleanup_temp.sh" - -# 🔐 immer kopieren (kein Skip mehr!) -cp "$TARGET_DIR/temp-cleanup/$SCRIPT_FILE" "$TARGET_DIR/temp-cleanup/" -cp "$TARGET_DIR/temp-cleanup/$SERVICE_FILE" "$TARGET_DIR/temp-cleanup/" -cp "$TARGET_DIR/temp-cleanup/$TIMER_FILE" "$TARGET_DIR/temp-cleanup/" 2>/dev/null || true - -chmod +x "$TARGET_DIR/temp-cleanup/$SCRIPT_FILE" - -# 🔧 Service fixen -sed "s|ExecStart=.*|ExecStart=$TARGET_DIR/temp-cleanup/$SCRIPT_FILE|" \ - "$TARGET_DIR/temp-cleanup/$SERVICE_FILE" > "$SYSTEMD_USER_DIR/cleanup-temp.service" - -cp "$TARGET_DIR/temp-cleanup/$TIMER_FILE" "$SYSTEMD_USER_DIR/" 2>/dev/null || true - -systemctl --user daemon-reload -systemctl --user enable cleanup-temp.timer 2>/dev/null || true -systemctl --user restart cleanup-temp.timer 2>/dev/null || true - -echo "✅ Installation abgeschlossen!" \ No newline at end of file +cd "$TARGET/temp-cleanup" +bash install.sh \ No newline at end of file