nm-online

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

Install

All systems
curl cmd.cat/nm-online.sh
Debian Debian
apt-get install network-manager
Ubuntu
apt-get install network-manager
Alpine
apk add networkmanager
Arch Arch Linux
pacman -S networkmanager
image/svg+xml Kali Linux
apt-get install network-manager
Fedora
dnf install NetworkManager-1
Windows (WSL2)
sudo apt-get update sudo apt-get install network-manager
Raspbian
apt-get install network-manager
Docker
docker run cmd.cat/nm-online nm-online powered by Commando

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

  • 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

© tl;dr; authors and contributors