wifinigel.MikrotikScripting/scripts/v7/ch7-09-if-binary-simplified.rsc

14 lines
372 B
Text
Raw Normal View History

2023-01-19 21:27:15 +00:00
# filename: ch7-09-if-binary-simplified.rsc
# define WAN interface name
:local WanInterfaceName "ether1-WAN";
# find the interface index
2023-02-19 13:53:15 +00:00
:local InterfaceId [/interface/ethernet find name=$WanInterfaceName];
2023-01-19 21:27:15 +00:00
:local UpDown "down";
2023-05-29 07:47:33 +01:00
if ([/interface/ethernet get $InterfaceId]->"running") do={
2023-01-19 21:27:15 +00:00
:set UpDown "up"
}
:put "Interface $WanInterface is currently $UpDown";