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