aboutsummaryrefslogtreecommitdiff
path: root/files/etc/wicd/macchanger
blob: 2febbb4e22c1883f8fefddd92e2e83226bf41275 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env bash
# thanks https://wiki.archlinux.org/index.php/Wicd#Change_MAC_using_macchanger

connection_type="$1"
wireless="wlan0"
wired="eth0"

if [[ "${connection_type}" == "wireless" ]]; then
  iface="$wireless"
elif [[ "${connection_type}" == "wired" ]]; then
  iface="$wired"
fi

ip link set $iface down
macchanger -A $iface
ip link set $iface up