nm-online.xml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <?xml version='1.0'?>
  2. <?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?>
  3. <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
  4. "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
  5. <!ENTITY % entities SYSTEM "common.ent" >
  6. %entities;
  7. ]>
  8. <!--
  9. nm-online(1) manual page
  10. Copyright 2010 - 2016 Red Hat, Inc.
  11. Permission is granted to copy, distribute and/or modify this document
  12. under the terms of the GNU Free Documentation License, Version 1.1
  13. or any later version published by the Free Software Foundation;
  14. with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
  15. Texts. You may obtain a copy of the GNU Free Documentation License
  16. from the Free Software Foundation by visiting their Web site or by
  17. writing to:
  18. Free Software Foundation, Inc.,
  19. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  20. -->
  21. <refentry id='nm-online'>
  22. <refentryinfo>
  23. <title>nm-online</title>
  24. <author>NetworkManager developers</author>
  25. </refentryinfo>
  26. <refmeta>
  27. <refentrytitle>nm-online</refentrytitle>
  28. <manvolnum>1</manvolnum>
  29. <refmiscinfo class="source">NetworkManager</refmiscinfo>
  30. <refmiscinfo class="manual">General Commands Manual</refmiscinfo>
  31. <refmiscinfo class="version">&NM_VERSION;</refmiscinfo>
  32. </refmeta>
  33. <refnamediv>
  34. <refname>nm-online</refname>
  35. <refpurpose>ask NetworkManager whether the network is connected</refpurpose>
  36. </refnamediv>
  37. <refsynopsisdiv id='synopsis'>
  38. <cmdsynopsis>
  39. <command>nm-online</command>
  40. <arg choice="opt" rep="repeat"><replaceable>OPTIONS</replaceable></arg>
  41. </cmdsynopsis>
  42. </refsynopsisdiv>
  43. <refsect1 id='description'><title>Description</title>
  44. <para><command>nm-online</command> is a utility to find out whether we are
  45. online. It is done by asking NetworkManager about its status. When run,
  46. <command>nm-online</command> waits until NetworkManager reports an active
  47. connection, or specified timeout expires. On exit, the returned status code
  48. should be checked (see the return codes below).</para>
  49. <para>By default NetworkManager waits for IPv4 dynamic addressing to complete
  50. but does not wait for the <literal>auto</literal> IPv6 dynamic addressing. To
  51. wait for IPv6 addressing to complete, either (1) change the network
  52. connection's IPv6 <literal>may-fail</literal> setting to <literal>no</literal>,
  53. and/or (2) change the IPv6 addressing method to <literal>manual</literal> or
  54. <literal>dhcp</literal>, to indicate that IPv6 connectivity is expected.</para>
  55. </refsect1>
  56. <refsect1 id='options'><title>Options</title>
  57. <variablelist>
  58. <varlistentry>
  59. <term>
  60. <group choice='plain'>
  61. <arg choice='plain'><option>-t</option></arg>
  62. <arg choice='plain'><option>--timeout</option></arg>
  63. </group>
  64. <arg choice='plain'><replaceable>seconds</replaceable></arg>
  65. </term>
  66. <listitem>
  67. <para>Time to wait for a connection, in seconds. If the option is not provided,
  68. the default timeout is 30 seconds.</para>
  69. </listitem>
  70. </varlistentry>
  71. <varlistentry>
  72. <term><group choice='plain'>
  73. <arg choice='plain'><option>-x</option></arg>
  74. <arg choice='plain'><option>--exit</option></arg>
  75. </group></term>
  76. <listitem>
  77. <para>Exit immediately if NetworkManager is not running or connecting.</para>
  78. </listitem>
  79. </varlistentry>
  80. <varlistentry>
  81. <term><group choice='plain'>
  82. <arg choice='plain'><option>-q</option></arg>
  83. <arg choice='plain'><option>--quiet</option></arg>
  84. </group></term>
  85. <listitem>
  86. <para>Don't print anything.</para>
  87. </listitem>
  88. </varlistentry>
  89. <varlistentry>
  90. <term><group choice='plain'>
  91. <arg choice='plain'><option>-s</option></arg>
  92. <arg choice='plain'><option>--wait-for-startup</option></arg>
  93. </group></term>
  94. <listitem>
  95. <para>Wait for NetworkManager startup to complete, rather than waiting for
  96. network connectivity specifically. Startup is considered complete once
  97. NetworkManager has activated (or attempted to activate) every auto-activate
  98. connection which is available given the current network state. (This is
  99. generally only useful at boot time; after startup has completed,
  100. <command>nm-online -s</command> will just return immediately, regardless of the
  101. current network state.)</para>
  102. </listitem>
  103. </varlistentry>
  104. </variablelist>
  105. </refsect1>
  106. <refsect1 id='exit_status'><title>Exit Status</title>
  107. <para><command>nm-online</command> exits with status 0 if it succeeds, a value
  108. greater than 0 is returned if an error occurs.</para>
  109. <variablelist spacing='compact' termlength='3'>
  110. <varlistentry>
  111. <term><errorcode>0</errorcode></term>
  112. <listitem>
  113. <para>Success &ndash; already online or connection established within given timeout.</para>
  114. </listitem>
  115. </varlistentry>
  116. <varlistentry>
  117. <term><errorcode>1</errorcode></term>
  118. <listitem>
  119. <para>Offline or not online within given timeout.</para>
  120. </listitem>
  121. </varlistentry>
  122. <varlistentry>
  123. <term><errorcode>2</errorcode></term>
  124. <listitem>
  125. <para>Unknown or unspecified error.</para>
  126. </listitem>
  127. </varlistentry>
  128. </variablelist>
  129. </refsect1>
  130. <refsect1 id='see_also'><title>See Also</title>
  131. <para><link linkend='nmcli'><citerefentry><refentrytitle>nmcli</refentrytitle><manvolnum>1</manvolnum></citerefentry></link>,
  132. <link linkend='NetworkManager'><citerefentry><refentrytitle>NetworkManager</refentrytitle><manvolnum>8</manvolnum></citerefentry></link>.</para>
  133. </refsect1>
  134. </refentry>