From 70768297473c117c6658cfde8ab589c371a820af Mon Sep 17 00:00:00 2001 From: Juergen Kunz Date: Sun, 19 Oct 2025 14:43:44 +0000 Subject: [PATCH] fix(install): detect enabled services even when failed/stopped during migration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously only checked 'is-active' which missed failed/stopped services. Now checks 'is-enabled' OR 'is-active' to ensure service file gets updated during v3→v4 migration regardless of service state. --- install.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index 6cf2d59..a84f30b 100644 --- a/install.sh +++ b/install.sh @@ -243,11 +243,15 @@ if [ -d "$INSTALL_DIR" ]; then echo "Updating existing installation at $INSTALL_DIR..." - # Check if service is running and stop it - if systemctl is-active --quiet nupst 2>/dev/null; then - echo "Stopping NUPST service..." - systemctl stop nupst + # Check if service exists (enabled or running) and stop it if active + if systemctl is-enabled --quiet nupst 2>/dev/null || systemctl is-active --quiet nupst 2>/dev/null; then SERVICE_WAS_RUNNING=1 + if systemctl is-active --quiet nupst 2>/dev/null; then + echo "Stopping NUPST service..." + systemctl stop nupst + else + echo "Service is installed but not currently running (will be updated)..." + fi fi # Clean up old Node.js installation files