nm-online
ask NetworkManager whether the network is connected
ask NetworkManager whether the network is connected
nm-online [ OPTIONS ]
nm-online is a utility to find out whether we are online. It is done by asking NetworkManager about its status. When run, nm-online waits until NetworkManager reports an active connection, or specified timeout expires. On exit, the returned status code should be checked (see the return codes bellow).