Skip to content

Instantly share code, notes, and snippets.

@kangarie
Last active January 26, 2023 16:04
Show Gist options
  • Save kangarie/3dc35301138bc8232b2571880753fa7c to your computer and use it in GitHub Desktop.
Save kangarie/3dc35301138bc8232b2571880753fa7c to your computer and use it in GitHub Desktop.
Mikrotik scheduler script to check connection by ping, restart when ping timeout
# isi dgn nama interface
:local interface "ovpn-client"
# isi dgn ip netwatch
:local ip "192.168.195.1"
:if ([/ping $ip count=5] = 0) do {
:log warning "Interface $interface is restarting"
/interface disable $interface
:delay 1
/interface enable $interface
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment