NetworkManager manual page you're reffering to, is stated :
The environment contains more information about the interface and the
connection. The following variables are available for the use in the
So this environment is obviously set up by dispatcher.d, and only accessible to scripts launched from there.
For example, you could put this line in a file in
echo "interface $DEVICE_IFACE" > /tmp/myscript.log
Still referring to the manual page of
NetworkManager, you will need to make it owned by root, executable, and not writable by group or others, for instance :
# chown root:root /etc/NetworkManager/dispatcher.d/myscript
# chmod a+x /etc/NetworkManager/dispatcher.d/myscript
# chmod go-w /etc/NetworkManager/dispatcher.d/myscript
Then, restarting NetworkManager, you should read something like "interface wlan0" in
Hope that helps.