Hello,
I have put together a script for "macchanger" to run at startup, and give a random MAC to all interfaces. The problem I'm having is getting it to run at startup. I've done:
chmod a+x macchanger (makes it executable)
chmod 777 macchanger (gives appropriate permissions)
update-rc.d macchanger start 92 1 2 3 4 5 . (adds to default runlevels?...not sure about this one)
When I run it normally after boot with "/etc/init.d/macchanger start" then it changes all macs with no problem, but still does not work at boot. Here is the script:
I have also tried added the full path of macchanger but that did not work as well.
I have put together a script for "macchanger" to run at startup, and give a random MAC to all interfaces. The problem I'm having is getting it to run at startup. I've done:
chmod a+x macchanger (makes it executable)
chmod 777 macchanger (gives appropriate permissions)
update-rc.d macchanger start 92 1 2 3 4 5 . (adds to default runlevels?...not sure about this one)
When I run it normally after boot with "/etc/init.d/macchanger start" then it changes all macs with no problem, but still does not work at boot. Here is the script:
Code:
#/bin/sh
# macchanger startup script
case "$1" in
start)
NICS="$( ifconfig -a | grep "Link encap:Ethernet" | cut -f 1 -d " " )"
# Randomize MAC address
for NIC in ${NICS}
do
macchanger -r ${NIC/*:/} >/dev/null 2>&1
macchanger -r ${NIC} > /dev/null 2>&1
sleep 1
done
;;
esac
exit 0
I have also tried added the full path of macchanger but that did not work as well.