1NM-ONLINE(1)                General Commands Manual               NM-ONLINE(1)
2
3
4

NAME

6       nm-online - ask NetworkManager whether the network is connected
7

SYNOPSIS

9       nm-online [OPTIONS...]
10

DESCRIPTION

12       nm-online is a utility to find out whether we are online. It is done by
13       asking NetworkManager about its status. When run, nm-online waits until
14       NetworkManager reports an active connection, or specified timeout
15       expires. On exit, the returned status code should be checked (see the
16       return codes below).
17
18       This tool is not very useful to call directly. It is however used by
19       NetworkManager-wait-online.service with --wait-for-startup argument
20       (see NetworkManager-wait-online.service(8)).
21
22       By default, connections have the ipv4.may-fail and ipv6.may-fail
23       properties set to yes; this means that NetworkManager waits for one of
24       the two address families to complete configuration before considering
25       the connection activated. If you need a specific address family
26       configured before network-online.target is reached, set the
27       corresponding may-fail property to no.
28

OPTIONS

30       -h | --help
31           Print help information.
32
33       -q | --quiet
34           Don't print anything.
35
36       -s | --wait-for-startup
37           Wait for NetworkManager startup to complete, rather than waiting
38           for network connectivity specifically. Startup is considered
39           complete once NetworkManager has activated (or attempted to
40           activate) every auto-activate connection which is available given
41           the current network state. This corresponds to the moment when
42           NetworkManager logs "startup complete". This mode is generally only
43           useful at boot time. After startup has completed, nm-online -s will
44           just return immediately, regardless of the current network state.
45
46           There are various ways to affect when startup complete is reached.
47           For details see NetworkManager-wait-online.service(8).
48
49       -t | --timeout seconds
50           Time to wait for a connection, in seconds. If the option is not
51           provided, the environment variable NM_ONLINE_TIMEOUT is honored.
52           The default timeout is 30 seconds.
53
54       -x | --exit
55           Exit immediately if NetworkManager is not running or connecting.
56

EXIT STATUS

58       nm-online exits with status 0 if it succeeds, a value greater than 0 is
59       returned if an error occurs.
60
61       0
62           Success – already online or connection established within given
63           timeout.
64
65       1
66           Offline or not online within given timeout.
67
68       2
69           Unknown or unspecified error.
70

SEE ALSO

72       nmcli(1), NetworkManager(8), NetworkManager-wait-online.service(8).
73
74
75
76NetworkManager 1.44.2                                             NM-ONLINE(1)
Impressum