The easiest way to do this is to run the script using crontab, but I would advise testing you script well first as you could make a script that causes problems.
$ crontab -e
and add the line:
Save and close, and then run
# update-rc.d cron defaults
Once you reboot the script will start automatically.
Well if you use Debian or Ubuntu is would suggest looking into that conf, apparently PRNG (Pseudo Random Number Generator) is predictable and installing a patch isn’t good enough to fix this problem. After installing the patch you will need to regenerate your keys.
All OpenSSH and X.509 keys generated on such systems must be considered untrustworthy, regardless of the system on which they are used, even after the update has been applied.
USN-612-1: OpenSSL vulnerability
DSA-1571-1 OpenSSL – Predictable Random Number Generator