From 79abfc22eecf75e497298b1bbb8d675227eac0f9 Mon Sep 17 00:00:00 2001 From: Jason Plum Date: Wed, 12 Mar 2014 13:32:25 -0400 Subject: [PATCH] Adding alarm/macspoof so people stop asking how to set MAC addresses. --- alarm/macspoof/PKGBUILD | 23 +++++++++++++++++++++++ alarm/macspoof/macspoof.conf.d | 4 ++++ alarm/macspoof/macspoof.install | 3 +++ alarm/macspoof/macspoof@.service | 13 +++++++++++++ 4 files changed, 43 insertions(+) create mode 100644 alarm/macspoof/PKGBUILD create mode 100644 alarm/macspoof/macspoof.conf.d create mode 100644 alarm/macspoof/macspoof.install create mode 100644 alarm/macspoof/macspoof@.service diff --git a/alarm/macspoof/PKGBUILD b/alarm/macspoof/PKGBUILD new file mode 100644 index 000000000..795adb498 --- /dev/null +++ b/alarm/macspoof/PKGBUILD @@ -0,0 +1,23 @@ +# Maintainer Jason Plum + +pkgname=macspoof +pkgdesc="MAC Spoofing service" +pkgver=0.1 +pkgrel=1 +arch=('any') + +url="https://wiki.archlinux.org/index.php/MAC_Address_Spoofing#Systemd_unit" +license=('GPL2') + +source=('macspoof@.service' + 'macspoof.conf.d') +md5sums=('c830b7ee6425390005189a2a01bb84eb' + 'b50f74e4b71d6fda819feb89ccb62bc3') +backup=('etc/conf.d/macspoof') +install=macspoof.install + +package() { + install -m644 -D "${srcdir}/macspoof.conf.d" "${pkgdir}/etc/conf.d/macspoof" + install -m644 -D "${srcdir}/macspoof@.service" "${pkgdir}/usr/lib/systemd/system/macspoof@.service" +} + diff --git a/alarm/macspoof/macspoof.conf.d b/alarm/macspoof/macspoof.conf.d new file mode 100644 index 000000000..f8886164b --- /dev/null +++ b/alarm/macspoof/macspoof.conf.d @@ -0,0 +1,4 @@ +# macspoof@.service configuration file +# example of setting for eth0 and wlan0 +# mac_addr_eth0=DE:AD:BE:EF:00:01 +# mac_addr_wlan0=DE:AD:BE:EF:00:02 \ No newline at end of file diff --git a/alarm/macspoof/macspoof.install b/alarm/macspoof/macspoof.install new file mode 100644 index 000000000..ca7876deb --- /dev/null +++ b/alarm/macspoof/macspoof.install @@ -0,0 +1,3 @@ +post_install() { + echo " Be sure to edit /etc/conf.d/macspoof" +} \ No newline at end of file diff --git a/alarm/macspoof/macspoof@.service b/alarm/macspoof/macspoof@.service new file mode 100644 index 000000000..fd9269b3f --- /dev/null +++ b/alarm/macspoof/macspoof@.service @@ -0,0 +1,13 @@ +[Unit] +Description=MAC address change %I +Before=dhcpcd@%i.service netctl@%1.service netctl-ifplugd@%i.service netctl-auto@%i.service + +[Service] +Type=oneshot +EnvironmentFile=/etc/conf.d/macspoof +ExecStart=/usr/bin/ip link set dev %i down +ExecStart=/usr/bin/ip link set dev %i address ${mac_addr_%i} + + +[Install] +WantedBy=network.target \ No newline at end of file