systemd management scripts
This commit is contained in:
20
scripts/remove.sh
Executable file
20
scripts/remove.sh
Executable 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."
|
||||
Reference in New Issue
Block a user