here is one more example of channels switching (fail-over), Multi-VPN switcher, see attach.
Can be useful for scripting funs. And may be also for switching VPN channels %)
https://www.mikrotik-club.in.ua/2018/02 ... -failover/ (in Russian)
1. Import and set/tune parameters in vpn-tunnel-check and vpn-interfaces scripts:
gw - what to ping
cnt2ping - how much too ping
minlevel - minimum allowed successful ping to count channel alive
imask - mask for switched channels. For example "^VPN*" means channels, starting from "VPN" in their name.
delayBeforeChecks - delay between enabling of channel and starting it's health check.
checkIfRunning - will we check "running" status. Makes sense for pptp/l2tp.
runningDelay - delays between "running" checks
runningMaxCount - how long we will wait for "running"=true
checkIfPing - will we check health of channel by pinging.
checkPing2Interface - will we specify interface during ping. I.e. will we ping via concrete interface.
ping2host - host to be pinged
pingMaxCount - how much to ping
pingMinCount - minimal successful pings to count channel alive
2. Check scripts vpn-tunnel-check and vpn-interfaces by running them from terminal.
3. Enable vpn-check-task scheduler task.