Run macchanger at system boot because pre-up doesn't work
The ifupdown.sh script says "NetworkManager does not run if-pre-up.d scripts", so I thought why not add a systemd service to run macchanger once during system boot. This is my modified script:
#!/bin/sh
# randomize MAC addresses of all network interfaces at boot
set -e
set -u
package=macchanger
. /etc/default/
if [ "$ENABLE_
for IFACE in $(ip -o link show | awk '{print $2}' | sed -e 's/:$//' | grep -v lo) ; do
echo "IFACE='$IFACE'"
done
else
echo "disabled in /etc/default/
fi
and this would be the service definition (adapted from https:/
[Unit]
Description=Change MAC addresses
[Service]
Type=oneshot
ExecStart=
#RemainAfterExi
[Install]
WantedBy=
What you think?
Question information
- Language:
- English Edit question
- Status:
- Answered
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Felix Triebel for more information if necessary.