dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit e4ba4392af16e607bbfdee67c15fe0f10b1398e0
parent 8448a8ca4840885151804162f4708dadc34b9d5d
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Tue,  7 May 2019 08:39:36 -0700

Begin rewriting for linux

Diffstat:
Mbin/spoof-mac-address.sh | 18+++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/bin/spoof-mac-address.sh b/bin/spoof-mac-address.sh @@ -1,32 +1,32 @@ #!/bin/bash -e -device=en0 +device=wlp3s0 -yellow=`tput setaf 3` -reset=`tput sgr0` +yellow=$(tput setaf 3) +reset=$(tput sgr0) function printmac { - echo $(ifconfig $device | grep ether | sed 's/ether //') + ip link show $device | awk '{print $2}' | tail -n 1 } echo -en "${yellow}Mac address of $device before:${reset}\t" printmac echo "Bringing $device down" -sudo ifconfig $device down +sudo ip link set $device down sleepduration=$(echo 10 + $RANDOM/1000 | bc) echo -e "${yellow}Sleeping $sleepduration seconds...${reset}" -sleep $sleepduration +sleep "$sleepduration" echo "Bringing $device up" -sudo ifconfig $device up +sudo ip link set $device up sleep 1 fakemac=$(od -An -N6 -tx1 /dev/urandom | \ sed -e 's/^ *//' -e 's/ */:/g' -e 's/:$//' -e 's/^\(.\)[13579bdf]/\10/') -echo "Spoofing MAC address for $device" -sudo ifconfig $device ether $fakemac +echo "Spoofing MAC address for $device to $fakemac" +sudo ip link set $device address "$fakemac" # TODO: check with internet echo -en "${yellow}Mac address of $device after:${reset}\t" printmac