diff --git a/update_firmware.sh b/update_firmware.sh index 21eaa03..5efcb7c 100755 --- a/update_firmware.sh +++ b/update_firmware.sh @@ -79,12 +79,17 @@ services=( for service in "${services[@]}"; do if systemctl list-unit-files | grep -q "$service"; then - print_status "Restarting service: $service" - sudo systemctl restart "$service" - if systemctl is-active --quiet "$service"; then - print_status "✓ $service is running" + # Check if service is enabled before restarting + if systemctl is-enabled --quiet "$service" 2>/dev/null; then + print_status "Restarting enabled service: $service" + sudo systemctl restart "$service" + if systemctl is-active --quiet "$service"; then + print_status "✓ $service is running" + else + print_status "⚠ $service failed to start" + fi else - print_status "⚠ $service may not be active" + print_status "ℹ Service $service is disabled, skipping restart" fi else print_status "ℹ Service $service not found (may not be installed)"