fix(install): detect enabled services even when failed/stopped during migration
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:
12
install.sh
12
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
|
||||
|
Reference in New Issue
Block a user