CmdID / Commands
Ask NetworkManager whether the network is connected. tldr-pages
On Linux
Opens CmdID with your command. It is read in your browser and sent nowhere.
Find out whether the network is connected and print the result to stdout
nm-online
Wait n seconds for a connection (30 by default)
nm-online --timeout n