I originally posted this to Newbie Corner because it's my first attempt at writing a bash script, but no one has replied so.....
It's intended to change my MAC address on startup, but it's not happening. I've got one script that turns off networking, changes the MAC, and turns networking back on. That works fine. But I have to run "sudo systemctl start macspoof@wlp2s0.service" to make it work.
#! /bin/sh
ip link set dev wlp2s0 down
macchanger -r wlp2s0
ip link set dev wlp2s0
The other one is a .service file that's supposed to run the above script at startup, but it's not happening.
[Unit]
Description=ZOMG! MAC! SPOOFER!!!!1! (This is just so I can see it in the forest of other stuff that runs at startup.)
Before=dhcpd@%i.service
[Service]
Type=oneshot
ExecStart=/bin/bash /home/chris/code/sh/macchanger.sh
[Install]
WantedBy=network.target
So I'm not sure what I'm doing wrong. Does anyone have any ideas?