mirror of
https://github.com/wifinigel/MikrotikScripting.git
synced 2025-06-21 17:29:00 +02:00
17 lines
No EOL
395 B
Text
17 lines
No EOL
395 B
Text
# filename: ch7-08-if-else-binary.rsc
|
|
|
|
# define WAN interface name
|
|
:local WanInterfaceName "ether1-WAN";
|
|
|
|
# find the interface ID
|
|
:local InterfaceId [/interface/ethernet find name=$WanInterfaceName];
|
|
|
|
:local UpDown;
|
|
|
|
if ([/interface ethernet get $InterfaceId]->"running") do={
|
|
:set UpDown "up";
|
|
} else={
|
|
:set UpDown "down";
|
|
}
|
|
|
|
:put "Interface $WanInterfaceName is currently $UpDown"; |