Open ckotte opened 1 year ago
What NetworkManager passes to the dispatcher script as $1
is the name of the interface -- or, in NetworkManager parlance, the "device". Not the name of the network. For the case of Docker bridges, it may be that the name of the device and the name of the network are the same. But I would not expect to put device names in the network exclusion file.
So to accomplish this it would be more appropriate to create a new /etc/nmtrust/excluded_devices
file and check against that in the dispatch script. I'd want the behaviour to be the same if nmtrust/ttoggle were executed manually, so the list_connections()
function in nmtrust would have to be modified to exclude connections on those devices.
If the concern is log noise it may be simpler to just add the -q
flag inside the dispatcher script.
Although it looks like the name of the connection ought to be available to the distpacher script in the CONNECTION_ID
environment variable. So something like your modified dispatcher example could work, but using $CONNECTION_ID
instead of $1
/$interface
.
The dispatcher script gets executed for every connection. In my case it's loopback, WiFi, Docker bridged networks, etc. pp. This only happens at the system startup. It doesn't have a real negative impact except logging many messages in the log. The services are just "started multiple times".
Those networks are all excluded:
/etc/nmtrust/excluded_networks
Does it make sense to ignore all excluded networks from the dispatcher execution? For example:
/etc/NetworkManager/dispatcher.d/10trust
So, does it make sense to only execute it for networks not excluded or just execute it every time?