Dateien nach "/" hochladen
This commit is contained in:
23
08_timer_disable.sh
Normal file
23
08_timer_disable.sh
Normal file
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
set -Eeuo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
|
||||
SERVICE_NAME="raspi-backup.service"
|
||||
TIMER_NAME="raspi-backup.timer"
|
||||
SERVICE_PATH="/etc/systemd/system/${SERVICE_NAME}"
|
||||
TIMER_PATH="/etc/systemd/system/${TIMER_NAME}"
|
||||
|
||||
[[ "${EUID:-$(id -u)}" -eq 0 ]] || { echo "Bitte mit sudo starten: sudo $SCRIPT_DIR/08_timer_disable.sh"; exit 1; }
|
||||
command -v systemctl >/dev/null 2>&1 || { echo "systemctl nicht gefunden."; exit 1; }
|
||||
|
||||
# stoppen/disable (egal ob existiert)
|
||||
systemctl disable --now "$TIMER_NAME" >/dev/null 2>&1 || true
|
||||
|
||||
# units löschen (falls vorhanden)
|
||||
rm -f "$SERVICE_PATH" "$TIMER_PATH"
|
||||
|
||||
systemctl daemon-reload
|
||||
|
||||
echo "Timer/Service deaktiviert und entfernt."
|
||||
echo "Check:"
|
||||
systemctl list-timers --all | grep -E "raspi-backup\.timer" || echo "OK: kein Timer mehr da."
|
||||
Reference in New Issue
Block a user