Mikrotik RouterOS wifi 状态关联列表脚本

技术资料 分享,软路由,脚本
0 620
admin
admin 自由达人 2024-08-01 23:11:40
用户等级:5级
  • # :local interfaces {"wifi24", "wifi50"}
  • :local interfaces [/interface wifi find where disabled=no]
  • :local ledOn [:len $interfaces]
  • :foreach iface in=$interfaces do={
  • :local nameIface [/interface get $iface name]
  • # Number of connected devices
  • :local count [:len [/interface wifi registration-table find where interface=$nameIface]]
  • # Don't like this one as it always print the count in console
  • #:local count [/interface wifi registration-table print count-only where interface=$nameIface]
  • # Disable interface
  • :if ($count = 0) do={
  • /interface wifi set $iface disabled=yes
  • # /interface wifi disable $iface
  • :local ssidIface [/interface wifi get [find name=$nameIface] configuration.ssid]
  • :log info message="Wifi \"$ssidIface\" ($nameIface) turned off"
  • set $ledOn ($ledOn - 1)
  • }
  • }
  • # Switch off led
  • :if ($ledOn = 0 and ([/system leds get [find where leds="user-led"] type] = "on")) do={
  • /system leds set [find where leds="user-led"] type=off
  • }
复制

楼主签名:唱跳rap和篮球
回帖
已上传或添加的图片
宽度
px
高度
px
说明
浮动
默认
  
附件状态: 待添加
下载附件消耗:
金币财富
升级经验
  
  
插入表格
宽度
100%
自动
边框

双击表格可删除表格

  
文件 类型 时间 操作
上一页 1 下一页 关闭
  
自动播放   
边框修饰
宽度    高度
  
自动播放
自动循环
  
回复列表