Adding alarm/macspoof so people stop asking how to set MAC addresses.

This commit is contained in:
Jason Plum 2014-03-12 13:32:25 -04:00
parent 90cd5a21bc
commit 79abfc22ee
4 changed files with 43 additions and 0 deletions

23
alarm/macspoof/PKGBUILD Normal file
View File

@ -0,0 +1,23 @@
# Maintainer Jason Plum <jplum@archlinuxarm.org>
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"
}

View File

@ -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

View File

@ -0,0 +1,3 @@
post_install() {
echo " Be sure to edit /etc/conf.d/macspoof"
}

View File

@ -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