I have a script that I want to be executed when wlan0 is taken down. I have tried both the following: a) place a script in /etc/network/if-down.d; b) place a script in /etc/NetworkManager/dispatcher.d. As far as I can tell, a) has no effect (the script is never run). For b) the script is run sometimes but not when wlan0 is taken down. For debugging purposes I have this:
Having checked that wlan0 is up, I do . Nothing is written to the tmp file at all.
I then do. The following is written:
Any ideas?
Code:
> cat /etc/NetworkManager/dispatcher.d/00-log-iface-events.sh#!/usr/bin/env bashinterface=$1event=$2echo "===========" >> /tmp/Hello-there.txtecho "$interface received $event" >> /tmp/Hello-there.txt
Code:
sudo ip link set wlan0 down
I then do
Code:
sudo ip link set wlan0 up
Code:
===========wlan0 received dhcp4-change===========wlan0 received dhcp6-change
Statistics: Posted by sebby999 — Wed Sep 25, 2024 8:39 pm — Replies 0 — Views 25