You could try placing your script in the /etc/init.d file. For more information check out this guide.
http://raspberrywebserver.com/serveradmin/run-a-script-on-start-up.html
If you want to be sure that everything is up and running before you execute your script you could add $all to the LSB header, for details check: