When I use ifupdown, I wrote a script in if-up.d and use $IFACE to detect the name of the device affected.
Now I turn to netplan in Ubuntu Server 18.04. 2 questions need to be solved:
1 Where to put the command to run the script? https://netplan.io/faq says there should be placed in /etc/networkd-dispatcher/routable.d/50-ifup-hooks. Only this file name is allowed? Actually, no such a directory in my instance at all.
2 How to detect the affected device name?