aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xfiles/etc/wicd/macchanger16
-rw-r--r--manifests/subsystem/macchanger.pp5
-rw-r--r--manifests/subsystem/macchanger/wicd.pp9
-rw-r--r--manifests/utils/laptop/debian.pp2
4 files changed, 31 insertions, 1 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
diff --git a/manifests/subsystem/macchanger.pp b/manifests/subsystem/macchanger.pp
new file mode 100644
index 0000000..f5e5438
--- /dev/null
+++ b/manifests/subsystem/macchanger.pp
@@ -0,0 +1,5 @@
+class nodo::subsystem::macchanger {
+ package { 'macchanger':
+ ensure => present,
+ }
+}
diff --git a/manifests/subsystem/macchanger/wicd.pp b/manifests/subsystem/macchanger/wicd.pp
new file mode 100644
index 0000000..18ee263
--- /dev/null
+++ b/manifests/subsystem/macchanger/wicd.pp
@@ -0,0 +1,9 @@
+class nodo::subsystem::macchanger::wicd inherits nodo::subsystem::macchanger {
+ file { '/etc/wicd/scripts/preconnect/macchanger':
+ ensure => present,
+ owner => root,
+ group => root,
+ mode => 0755,
+ source => 'puppet:///modules/nodo/etc/wicd/macchanger',
+ }
+}
diff --git a/manifests/utils/laptop/debian.pp b/manifests/utils/laptop/debian.pp
index e42b999..5f5c0c7 100644
--- a/manifests/utils/laptop/debian.pp
+++ b/manifests/utils/laptop/debian.pp
@@ -8,7 +8,7 @@ class nodo::utils::laptop::debian {
'iw', 'wvdial', 'wavemon',
'btscanner', 'laptop-mode-tools', 'acpi-support',
'tftp', 'sharutils', 'wireshark',
- 'macchanger', 'weplab', 'wpagui',
+ 'weplab', 'wpagui',
'gnokii', 'sslstrip', 'uswsusp',
'tcpdump', 'tshark' ]:
ensure => installed,