diff --git a/board/coreboot/rootfs-additions/etc/network/if-pre-up.d/00macchanger b/board/coreboot/rootfs-additions/etc/network/if-pre-up.d/00macchanger deleted file mode 100755 index d4310b0..0000000 --- a/board/coreboot/rootfs-additions/etc/network/if-pre-up.d/00macchanger +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -if [ "$IFACE" != "lo" ]; then - /usr/bin/macchanger --bia -a "$IFACE" -fi diff --git a/board/coreboot/rootfs-additions/etc/network/ip-up.d/00setcdra b/board/coreboot/rootfs-additions/etc/network/if-up.d/00setcdra similarity index 100% rename from board/coreboot/rootfs-additions/etc/network/ip-up.d/00setcdra rename to board/coreboot/rootfs-additions/etc/network/if-up.d/00setcdra diff --git a/board/coreboot/rootfs-additions/sbin/hotplug b/board/coreboot/rootfs-additions/sbin/hotplug index 3a33b93..b124057 100755 --- a/board/coreboot/rootfs-additions/sbin/hotplug +++ b/board/coreboot/rootfs-additions/sbin/hotplug @@ -1,3 +1,12 @@ #!/bin/sh find /sys -name modalias | xargs sort -u | xargs modprobe -a 2> /dev/null + +for devfile in /sys/class/net/*; do + if [ $(echo $devfile | grep -E '^\/.+\/(eth|wlan)[0-9]+$') ]; then + if [ "$(cat $devfile/operstate)" = "down" ]; then + echo "Spoofing MAC address for: ${devfile##*/}" + /usr/bin/macchanger --bia --another ${devfile##*/} + fi + fi +done