In signature you see a link and that topic also contains a script to restart a peer if it went down. It only restarts peers that are enabled and you can rewrite that to enable disabled peers.
A meaningful name for the peer is essential or you have to use the comment field as already suggested.
This is the little script:
viewtopic.php?f=2&t=158439&p=781009#p780659
Underneath the latest version that can can do more:
# IKEv2 maintainer by Blacklister version: 20200510 2.0
# Not for commercial use
# Restarts the IKEv2 connection when it stops and is enabled in /ip ipsec peers
# That is restart is tried 15 times and then it stops for 15 times and so on.
# The Interval set on this scheduler spaces that out in time
{
# only load myFunc if not already loaded
if [/system script environment find name=myFuncPresent] do={} else={/system script run myFunc;}
#Change to IPsec peer to have that as default location to run commands
/ip ipsec peer
#Loop through names of the peers and see if they need restart
:foreach peerID in=[/ip ipsec peer find disabled=no] do={
:set $peerName [/ip ipsec peer get $peerID name ];
:if ([/ip ipsec policy find peer=$peerName]="") do={
:set $cleanedPeerName [$replaceCharacterFunc $peerName "-"]
:local envName ("restarted".$cleanedPeerName) ;
:if ([/sys script env find name=$envName]) do={} else={[:parse "global $envName 0"];}
:local tempCount [/sys script env get [find name="$envName"] value ]
:set $tempCount ($tempCount + 1)
# if the counter comes over 15 then a time-out of 15 repeats, of the used scheduled interval is activated.
:if ($tempCount < 16) do={
:log warning "$peerName not active, restarting.."
disable $peerName; :delay 1500ms; enable $peerName}
:if ($tempCount > 30) do={:set $tempCount 1; :log warning "Counter reset to 1 for $envName"}
[:parse "global $envName $tempCount"]
} } }; # if..if..foreach
# hier nog het wissen van de variable en de counter als de verbinding weer staat.
# You can create a schedule that removes the restarted variables with the following script
# /system script environment remove [find name~"restarted"];
}
This line looks if a peer is enabled and you can reverse that by using disabled=yes.
:foreach peerID in=[/ip ipsec peer find disabled=yes] do={
This is the link to the Function that is called in this script. You can can copy the top one to this script to run it locally or two lower ones to run them system-wide.
viewtopic.php?f=9&t=160989#p792275