4 Running Scripts When Network Events Occur
You can configure the system to respond to network events by providing scripts for NetworkManager-dispatcher
to run. Use a script, for example, to mount a remote file system when a device is brought up or send a notification when a device loses connectivity.
When network actions occur,
NetworkManager.service
starts NetworkManager-dispatcher.service
, which runs the scripts in /etc/NetworkManager/dispatcher.d/
following these parameters:
- One script runs at a time.
- Scripts run in sequence based on the order in which network events occur.
- After the dispatcher service queues a script, the script always runs, even if a later action makes the script unnecessary.
- NetworkManager terminates scripts if they run for too long.