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