mirror of
https://github.com/wifinigel/MikrotikScripting.git
synced 2025-06-23 18:18:40 +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
17
scripts/v6/ch7-08-if-else-binary.rsc
Normal file
17
scripts/v6/ch7-08-if-else-binary.rsc
Normal file
|
@ -0,0 +1,17 @@
|
|||
# filename: ch7-08-if-else-binary.rsc
|
||||
|
||||
# define WAN interface name
|
||||
:local WanInterfaceName "ether1-WAN";
|
||||
|
||||
# find the interface index
|
||||
:local InterfaceIndex [/interface ethernet find name=$WanInterfaceName];
|
||||
|
||||
:local UpDown;
|
||||
|
||||
if ([:interface ethernet get $InterfaceIndex]->"running") do={
|
||||
:set UpDown "up";
|
||||
} else={
|
||||
:set UpDown "down";
|
||||
}
|
||||
|
||||
:put "Interface $WanInterfaceName is currently $UpDown";
|
Loading…
Add table
Add a link
Reference in a new issue