#!/bin/bash

unset trub

trub = ` sudo ip link | grep BROADCAST | cut -d: -f2 `

#uses 'ip link' to get info about networking devices

# searches ip link for lines containing "BROADCAST" (the ethernet card)

# cuts the second field/column (this field contains the device name)

#saves the device name to the variable 'trub'

sudo ip link set $trub down

#brings the interface down

sleep 5

#wait a bit

sudo ip link set $trub address 00:1d: 98 :5b:5b:5b

#change the mac address

sudo ip link set $trub up

#re-initialise the network interface

sudo dhcpcd $trub