IPSec redundancy

Hello,
I have established an IPSec connection with a third party company to collect payments using as a primary peer my primary ISP, if my primary peer crashes I want the vpn automatically reestablished through my second peer (different ISP)for redundancy.
Is there a script to make this happen?
How can I set up this in the mikrotik?
Can you please assist me on this.

Thank You,

I think you can do something like this: https://wiki.mikrotik.com/wiki/Advanced_Routing_Failover_without_Scripting