#!/usr/bin/env bash set -e echo "πŸ“¦ Installiere Temp Cleanup System..." # 🧠 Basisverzeichnis bestimmen BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" # πŸ” PrΓΌfen wo wir sind if [[ -f "$BASE_DIR/cleanup_temp.sh" ]]; then # install.sh liegt in temp-cleanup/ SCRIPT_DIR="$BASE_DIR" elif [[ -f "$BASE_DIR/temp-cleanup/cleanup_temp.sh" ]]; then # install.sh liegt im Repo-Root SCRIPT_DIR="$BASE_DIR/temp-cleanup" else echo "❌ cleanup_temp.sh nicht gefunden!" exit 1 fi SERVICE_FILE="$SCRIPT_DIR/systemd/cleanup-temp.service" SCRIPT_TARGET="$SCRIPT_DIR/cleanup_temp.sh" SYSTEMD_USER_DIR="$HOME/.config/systemd/user" TARGET_SERVICE="$SYSTEMD_USER_DIR/cleanup-temp.service" LOG_FILE="$HOME/cleanup_temp.log" echo "πŸ“ Script gefunden unter: $SCRIPT_TARGET" # πŸ” Script ausfΓΌhrbar machen chmod +x "$SCRIPT_TARGET" # πŸ“ systemd user dir sicherstellen mkdir -p "$SYSTEMD_USER_DIR" # πŸ“„ Service installieren echo "πŸ“„ Installiere systemd Service..." cp "$SERVICE_FILE" "$TARGET_SERVICE" # πŸ”„ systemd reload echo "πŸ”„ Reload systemd..." systemctl --user daemon-reload # ▢️ Service aktivieren + starten systemctl --user enable cleanup-temp.service || true systemctl --user restart cleanup-temp.service || true echo "πŸ“œ Logfile: $LOG_FILE" echo "βœ… Installation abgeschlossen!"