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