NetworkManager/dispatcher
Thomas Haller 2800232bbf 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"`.

(cherry picked from commit ce9619047c)
2018-06-18 14:19:16 +02:00
..
tests build: use default NM_BUILD_* defines for tests 2018-05-31 15:59:38 +02:00
meson.build build/meson: use variables for ldflags and linker-script 2018-01-11 12:46:01 +01:00
nm-dispatcher-utils.c dispatcher: add NM_DISPATCHER_ACTION environment variable 2018-06-18 14:19:16 +02:00
nm-dispatcher-utils.h callouts/dispatcher: rename directory callouts 2016-10-13 21:33:33 +02:00
nm-dispatcher.c all: use the elvis operator wherever possible 2018-05-10 14:36:58 +02:00
nm-dispatcher.conf callouts/dispatcher: rename directory callouts 2016-10-13 21:33:33 +02:00
nm-dispatcher.xml callouts/dispatcher: rename directory callouts 2016-10-13 21:33:33 +02:00
org.freedesktop.nm_dispatcher.service.in callouts/dispatcher: rename directory callouts 2016-10-13 21:33:33 +02:00