This script by user ‘kwall’ works well for the ssh-agent. Add ssh-add before the last ‘fi’ to add the default ssh keys into it as well.

By karlo