testsAndMisc/python_pkg/screen_locker/remove_systemd.sh

24 lines
668 B
Bash
Raw Normal View History

2025-11-18 18:07:15 +01:00
#!/bin/bash
# Remove workout locker systemd service
SERVICE_NAME="workout-locker.service"
TIMER_NAME="workout-locker.timer"
2025-11-18 18:07:15 +01:00
USER_SERVICE_DIR="$HOME/.config/systemd/user"
# Stop the service and timer if running
systemctl --user stop "$TIMER_NAME" 2>/dev/null
2025-11-18 18:07:15 +01:00
systemctl --user stop "$SERVICE_NAME" 2>/dev/null
# Disable the service and timer
systemctl --user disable "$TIMER_NAME" 2>/dev/null
2025-11-18 18:07:15 +01:00
systemctl --user disable "$SERVICE_NAME" 2>/dev/null
# Remove service and timer files
2025-11-18 18:07:15 +01:00
rm -f "$USER_SERVICE_DIR/$SERVICE_NAME"
rm -f "$USER_SERVICE_DIR/$TIMER_NAME"
2025-11-18 18:07:15 +01:00
# Reload systemd daemon
systemctl --user daemon-reload
echo "✓ Workout locker service and timer removed"