systemd management scripts

This commit is contained in:
2026-02-17 12:13:39 +09:00
parent 60d99a993f
commit af7fb2beaf
4 changed files with 108 additions and 22 deletions

20
scripts/remove.sh Executable file
View File

@@ -0,0 +1,20 @@
#!/usr/bin/env bash
# Stop, disable, and remove the pi-dashboard systemd service.
set -euo pipefail
SERVICE_NAME="pi-dashboard"
UNIT_FILE="/etc/systemd/system/${SERVICE_NAME}.service"
echo "==> Stopping ${SERVICE_NAME}..."
sudo systemctl stop "${SERVICE_NAME}" || true
echo "==> Disabling ${SERVICE_NAME}..."
sudo systemctl disable "${SERVICE_NAME}" || true
echo "==> Removing unit file..."
sudo rm -f "${UNIT_FILE}"
echo "==> Reloading systemd..."
sudo systemctl daemon-reload
echo "==> Done. Service removed."