diff options
author | Thomas Haller <thaller@redhat.com> | 2018-06-18 13:08:16 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-06-18 14:18:08 +0200 |
commit | ce9619047c5daac9a006d16d07453d50e0520e71 (patch) | |
tree | 34b9894a540429b852600ecca9386b92a3bcb3d1 /man | |
parent | 4822bff7aae81b84b3230b4ad3e59879fed4a43e (diff) |
dispatcher: add NM_DISPATCHER_ACTION environment variable
Previously, the action was only passed as the first command line
argument to the dispatcher scripts. Now, also set it via the
"$NM_DISPATCHER_ACTION" environment variable.
The main purpose is to have a particular, nm-dispatcher specific
variable that is always set inside the dispatcher scripts.
For example, imagine you have a script that can be either called by
dispatcher or some other means (manually, or spawned via
/etc/NetworkManager/dispatcher.d/11-dhclient). Then it might make
sense to differenciate from inside the script whether you are called
by nm-dispatcher. But previously, there was no specific environment
variable that was always set inside the dispatcher event. For example,
with the "hostname" action there are no other environment variables.
Now (with version 1.12), you can check for `test -n "$NM_DISPATCHER_ACTION"`.
Diffstat (limited to 'man')
-rw-r--r-- | man/NetworkManager.xml | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/man/NetworkManager.xml b/man/NetworkManager.xml index 0ec6b0aee..7b0513bb9 100644 --- a/man/NetworkManager.xml +++ b/man/NetworkManager.xml @@ -182,6 +182,13 @@ The following variables are available for the use in the dispatcher scripts: <variablelist class="dispatcher-environment"> <varlistentry> + <term><varname>NM_DISPATCHER_ACTION</varname></term> + <listitem><para> + The dispatcher action like "up" or "dhcp4-change", identical to the first + command line argument. Since NetworkManager 1.12.0. + </para></listitem> + </varlistentry> + <varlistentry> <term><varname>CONNECTION_UUID</varname></term> <listitem><para> The UUID of the connection profile. |