mirror of
https://github.com/wifinigel/MikrotikScripting.git
synced 2025-07-05 07:34:31 +02:00
update for v6/v7 support
This commit is contained in:
parent
4871e9432b
commit
b10b99bd87
120 changed files with 1479 additions and 22 deletions
|
@ -1,28 +0,0 @@
|
|||
# filename: ch7-02-basic-if.rsc
|
||||
|
||||
# Create a variable for the WAN interface name
|
||||
:local WanInterface "ether1-WAN";
|
||||
|
||||
# Create a variable for the number of pings we'd like to send
|
||||
:local PingCount 10;
|
||||
|
||||
# Create a variable for the destination on the Internet to ping
|
||||
:local DestinationAddress 8.8.8.8;
|
||||
|
||||
# Let's try a ping to the Internet across the WAN interface
|
||||
:local WanPingCount [/ping $DestinationAddress interface=$WanInterface \
|
||||
count=$PingCount];
|
||||
|
||||
# Let's log the result of our Internet connection test
|
||||
if ( $WanPingCount = $PingCount) do={
|
||||
:log info "The Internet is up.";
|
||||
}
|
||||
|
||||
if ( $WanPingCount = 0) do={
|
||||
:log error "The Internet is down.";
|
||||
|
||||
}
|
||||
|
||||
if ( ($WanPingCount < $PingCount) and ($WanPingCount > 0) ) do={
|
||||
:log warning "The Internet connection may be degraded. (Ping result: $WanPingCount/$PingCount)";
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue