Requirement is to change the MAC address on identifying that eth0 is up. I have a crude solution now, ie. a snap (daemon : oneshot) which executes below shell script to update MAC at bootup.
apps:
chmac:
command: usr/bin/chmac
daemon: oneshot
#! /bin/sh
sudo ip link set dev eth0 down
sleep 1
sudo ip link set dev eth0 address "XX:XX:XX:XX:XX:XX"
sleep 1
sudo ip link set dev eth0 up
However, I am looking for event driven approach, i.e. the snap should execute the script on identifying eth0 link up. Please help…!!