Some commentors already stated that answers to your question will not work for all distributions. Since you did not include CentOS in the question but only in the tags, I'd like to post here the topics one has to understand in order to have a control over his/her proceeding regardless of the distribution:
For your problem, one could start the script on sysinit by adding this line in /etc/inittab and make it respawn in case it terminates:
# start and respawn after termination
ttyS0::respawn:/bin/sh /path/to/my_script.sh
The script has to be made executable in advance of course:
chmod +x /path/to/my_script.sh
Hope this helps