aboutsummaryrefslogtreecommitdiff
path: root/files/etc/wicd/macchanger
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2016-08-24 17:34:51 -0300
committerSilvio Rhatto <rhatto@riseup.net>2016-08-24 17:34:51 -0300
commitf92d0e8d42835473b46615c903d1a56652d45420 (patch)
tree3fc4f2e07c6f938a32b2f75b17c25949060ded83 /files/etc/wicd/macchanger
parent26727a6ad879ba4df22ad8e9cbe94ca0b329599a (diff)
downloadpuppet-nodo-f92d0e8d42835473b46615c903d1a56652d45420.tar.gz
puppet-nodo-f92d0e8d42835473b46615c903d1a56652d45420.tar.bz2
MAC Changer support
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