You forgot something that i test, you can launch it directly.
You just need to add this in the repository /etc/rc.local before the line "exit 0"
/bin/bash /etc/init.d/extract_mac.sh
If you do this, the script will launch automatically if the MAC didn't correspond, and if they correspond then he will don't reboot so you don't have to launch it manually if you had these line.