hy-app-monitor/scripts/uninstall_systemd.sh
2026-04-23 01:56:18 +08:00

25 lines
573 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
# shellcheck disable=SC1091
source "$SCRIPT_DIR/common.sh"
if command -v systemctl >/dev/null 2>&1; then
name=""
for name in $(suite_service_names); do
systemctl disable --now "$(service_unit_name "$name")" >/dev/null 2>&1 || true
done
fi
name=""
for name in $(suite_service_names); do
rm -f "/etc/systemd/system/$(service_unit_name "$name")"
done
if command -v systemctl >/dev/null 2>&1; then
systemctl daemon-reload || true
fi
echo "systemd units removed"