add lines to
/etc/rc.local
Save your script to:
<code>
/etc/init.d/script
</code>
Make it executable:
<code>
$ sudo chmod 755 /etc/init.d/superscript
</code>
Register script to be run at startup:
<code>
$ sudo update-rc.d superscript defaults
</code>
http://raspberrypi.stackexchange.com/questions/8734/execute-script-on-start-up