aboutsummaryrefslogtreecommitdiffstats
path: root/hook/randommac
blob: b6bddc3faeeee164e2066f10fa0dd8ae2dc63e8b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh

run_hook() {
	if [[ "${randommac}" == "y" ]]; then
		if [[ -n "${ip}" ]]; then
			changemac="$(echo ${ip} | cut -d: -f6)"
		fi
		if [[ -z "${changemac}" ]]; then
			changemac="eth0"
		fi

		msg ":: Initializing network interface ${changemac} with random mac address..."
		macchanger -e ${changemac}
	fi
}