nm-online

Ask NetworkManager whether the network is connected. More information: https://networkmanager.dev/docs/api/latest/nm-online.html.

nm-online

nm-online --timeout n