Here is a very simple example how to create an upstart script:
https://wiki.frugalware.org/index.php/Upstart_Job_HOWTO
UPDATE: above link is broken. Here is an example of a script:
description "My startup service"
author "You or someone else"
version "3.14"
pre-start script
echo 'Starting my service ...'
end script
start on net-device-up
stop on runlevel [!2345]
console output
respawn
exec /path/to/your/custom/script
Adapt as necessary.
You should place the script in /etc/init/yourfilename.conf
Then reload the configuration with:
sudo initctl reload-configuration
And if all is OK, you should be able to start it with:
sudo start yourfilename