aboutsummaryrefslogtreecommitdiff
path: root/files/etc/wicd/macchanger
diff options
context:
space:
mode:
Diffstat (limited to 'files/etc/wicd/macchanger')
-rwxr-xr-xfiles/etc/wicd/macchanger16
1 files changed, 16 insertions, 0 deletions
diff --git a/files/etc/wicd/macchanger b/files/etc/wicd/macchanger
new file mode 100755
index 0000000..2febbb4
--- /dev/null
+++ b/files/etc/wicd/macchanger
@@ -0,0 +1,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