From ee2073d315e9c8ddf4a2f11fd29a6e89b6b337a9 Mon Sep 17 00:00:00 2001 From: xSmurf Date: Tue, 29 Sep 2015 16:33:10 +0000 Subject: [PATCH] Fixed macchanger setup --- .../etc/network/if-pre-up.d/00macchanger | 5 ----- .../etc/network/{ip-up.d => if-up.d}/00setcdra | 0 board/coreboot/rootfs-additions/sbin/hotplug | 9 +++++++++ 3 files changed, 9 insertions(+), 5 deletions(-) delete mode 100755 board/coreboot/rootfs-additions/etc/network/if-pre-up.d/00macchanger rename board/coreboot/rootfs-additions/etc/network/{ip-up.d => if-up.d}/00setcdra (100%) 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