fix(install): detect enabled services even when failed/stopped during migration
All checks were successful
CI / Type Check & Lint (push) Successful in 6s
CI / Build Test (Current Platform) (push) Successful in 5s
CI / Build All Platforms (push) Successful in 49s

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.
This commit is contained in:
2025-10-19 14:43:44 +00:00
parent 1387ca262b
commit 7076829747

View File

@@ -243,11 +243,15 @@ if [ -d "$INSTALL_DIR" ]; then
echo "Updating existing installation at $INSTALL_DIR..." echo "Updating existing installation at $INSTALL_DIR..."
# Check if service is running and stop it # 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 if systemctl is-active --quiet nupst 2>/dev/null; then
echo "Stopping NUPST service..." echo "Stopping NUPST service..."
systemctl stop nupst systemctl stop nupst
SERVICE_WAS_RUNNING=1 else
echo "Service is installed but not currently running (will be updated)..."
fi
fi fi
# Clean up old Node.js installation files # Clean up old Node.js installation files