temp-cleanup/install.sh aktualisiert

This commit is contained in:
kai
2026-04-24 12:50:28 +00:00
parent 8a82915276
commit 178953c430
+11 -18
View File
@@ -2,36 +2,29 @@
set -e
echo "📦 Installiere Temp Cleanup System..."
echo "📦 Temp Cleanup Setup (CLEAN VERSION)"
CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
SYSTEMD_USER_DIR="$HOME/.config/systemd/user"
SERVICE_NAME="cleanup-temp.service"
TIMER_NAME="cleanup-temp.timer"
SCRIPT_NAME="cleanup_temp.sh"
SERVICE="cleanup-temp.service"
TIMER="cleanup-temp.timer"
SCRIPT="cleanup_temp.sh"
echo "📁 Current: $CURRENT_DIR"
mkdir -p "$SYSTEMD_USER_DIR"
# 🚨 ABSOLUT KEIN COPY, KEINE INSTALLATION VON DATEIEN
# Repo IST die Installation
echo "⚙️ systemd setup only (NO FILE COPYING ANYMORE)"
echo "⚙️ Installiere systemd Units..."
sed "s|ExecStart=.*|ExecStart=$CURRENT_DIR/$SCRIPT|" \
"$CURRENT_DIR/systemd/$SERVICE" > "$SYSTEMD_USER_DIR/$SERVICE"
# Service erzeugen (zeigt direkt auf Repo)
sed "s|ExecStart=.*|ExecStart=$CURRENT_DIR/$SCRIPT_NAME|" \
"$CURRENT_DIR/systemd/$SERVICE_NAME" > "$SYSTEMD_USER_DIR/$SERVICE_NAME"
cp "$CURRENT_DIR/systemd/$TIMER" "$SYSTEMD_USER_DIR/$TIMER"
# Timer direkt übernehmen
cp "$CURRENT_DIR/systemd/$TIMER_NAME" "$SYSTEMD_USER_DIR/$TIMER_NAME"
echo "🔄 systemd reload..."
systemctl --user daemon-reload
echo "🚀 enable + start timer..."
systemctl --user enable "$TIMER_NAME" >/dev/null 2>&1 || true
systemctl --user start "$TIMER_NAME" >/dev/null 2>&1 || true
systemctl --user enable "$TIMER" >/dev/null 2>&1 || true
systemctl --user start "$TIMER" >/dev/null 2>&1 || true
echo "✅ Temp Cleanup aktiv"
echo "✅ DONE"