The task is to compare every iteration value of current-bytes. If current-bytes value doesn’t change, we flush ipsec-session. I try this:
:global curb [/ip ipsec installed-sa get 0 current-bytes]; :global temp; :if ($curb = $temp) do={ /ip ipsec installed-sa flush; :set curb 0} else= {:set temp $curb;}
Unfortunately in such form this script doesn’t work. Any advice?
Print out values - does it even set curb? Usually you don’t want to get or set values based on numeric identifiers (get 0 whatever) in scripts, those are just human friendly identifiers and may not work. Try using a find command instead.
During first several iterations I got the correct values of curb. But during other times I got just blank field.
I also try to use a find command, but have the same blank result.