chenyc
2026-04-21 8632fbd73fdb15f22fae9cd36b9ed3e0635360f1
1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/env bash
set -euo pipefail
 
SERVICE_NAME="${SERVICE_NAME:-jhm-service}"
TARGET_PATH="/etc/systemd/system/${SERVICE_NAME}.service"
 
sudo systemctl stop "${SERVICE_NAME}" || true
sudo systemctl disable "${SERVICE_NAME}" || true
sudo rm -f "${TARGET_PATH}"
sudo systemctl daemon-reload
 
echo "Service removed: ${SERVICE_NAME}"