01_leds 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. #!/bin/sh
  2. . /lib/functions/uci-defaults.sh
  3. board_config_update
  4. board=$(board_name)
  5. boardname="${board##*,}"
  6. case "$board" in
  7. avm,fritz300e)
  8. ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth0"
  9. ucidef_set_rssimon "wlan0" "200000" "1"
  10. ucidef_set_led_rssi "rssilow" "RSSILOW" "$boardname:green:rssi0" "wlan0" "1" "100"
  11. ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "$boardname:green:rssi1" "wlan0" "20" "100"
  12. ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "$boardname:green:rssi2" "wlan0" "40" "100"
  13. ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "$boardname:green:rssi3" "wlan0" "60" "100"
  14. ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "$boardname:green:rssi4" "wlan0" "80" "100"
  15. ;;
  16. avm,fritz4020)
  17. ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth0"
  18. ucidef_set_led_switch "lan" "LAN" "$boardname:green:lan" "switch0" "0x1E"
  19. ;;
  20. buffalo,whr-g301n)
  21. ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth0"
  22. ucidef_set_led_switch "lan1" "LAN1" "$boardname:green:lan1" "switch0" "0x02"
  23. ucidef_set_led_switch "lan2" "LAN2" "$boardname:green:lan2" "switch0" "0x04"
  24. ucidef_set_led_switch "lan3" "LAN3" "$boardname:green:lan3" "switch0" "0x08"
  25. ucidef_set_led_switch "lan4" "LAN4" "$boardname:green:lan4" "switch0" "0x10"
  26. ;;
  27. etactica,eg200)
  28. ucidef_set_led_netdev "lan" "LAN" "$boardname:red:eth0" "eth0"
  29. ucidef_set_led_oneshot "modbus" "Modbus" "$boardname:red:modbus" "100" "33"
  30. ucidef_set_led_default "etactica" "etactica" "$boardname:red:etactica" "ignore"
  31. ;;
  32. glinet,gl-x750)
  33. ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth0"
  34. ;;
  35. netgear,wnr612-v2|\
  36. on,n150r)
  37. ucidef_set_led_netdev "wan" "WAN" "netgear:green:wan" "eth0"
  38. ucidef_set_led_switch "lan1" "LAN1" "netgear:green:lan1" "switch0" "0x02" "0x0f"
  39. ucidef_set_led_switch "lan2" "LAN2" "netgear:green:lan2" "switch0" "0x04" "0x0f"
  40. ;;
  41. pcs,cap324)
  42. ucidef_set_led_netdev "lan" "LAN" "pcs:lan:green" "eth0"
  43. ;;
  44. pcs,cr3000)
  45. ucidef_set_led_netdev "wan" "WAN" "pcs:blue:wan" "eth1"
  46. ucidef_set_led_switch "lan1" "LAN1" "pcs:blue:lan1" "switch0" "0x04"
  47. ucidef_set_led_switch "lan2" "LAN2" "pcs:blue:lan2" "switch0" "0x08"
  48. ucidef_set_led_switch "lan3" "LAN3" "pcs:blue:lan3" "switch0" "0x10"
  49. ucidef_set_led_switch "lan4" "LAN4" "pcs:blue:lan4" "switch0" "0x02"
  50. ;;
  51. tplink,archer-a7-v5)
  52. ucidef_set_led_switch "wan" "WAN" "tp-link:green:wan" "switch0" "0x02"
  53. ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x04"
  54. ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x08"
  55. ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x10"
  56. ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x20"
  57. ;;
  58. tplink,archer-c58-v1|\
  59. tplink,archer-c59-v1)
  60. ucidef_set_led_switch "lan" "LAN" "tp-link:green:lan" "switch0" "0x1E"
  61. ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth0"
  62. ;;
  63. tplink,re450-v2)
  64. ucidef_set_led_netdev "lan_data" "LAN Data" "tp-link:green:lan_data" "eth0" "tx rx"
  65. ucidef_set_led_netdev "lan_link" "LAN Link" "tp-link:green:lan_link" "eth0" "link"
  66. ;;
  67. tplink,tl-mr3020-v1|\
  68. tplink,tl-mr3040-v2)
  69. ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan" "eth0"
  70. ;;
  71. tplink,tl-wr1043nd-v4)
  72. ucidef_set_led_switch "wan" "WAN" "tp-link:green:wan" "switch0" "0x20"
  73. ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x10"
  74. ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x08"
  75. ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x04"
  76. ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x02"
  77. ;;
  78. tplink,tl-wr740n-v1|\
  79. tplink,tl-wr740n-v3|\
  80. tplink,tl-wr741-v1|\
  81. tplink,tl-wr743nd-v1|\
  82. tplink,tl-wr841-v5|\
  83. tplink,tl-wr941-v4)
  84. ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth0"
  85. ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x02"
  86. ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x04"
  87. ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x08"
  88. ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x10"
  89. ;;
  90. tplink,tl-wr740nd-v4|\
  91. tplink,tl-wr741nd-v4|\
  92. tplink,tl-wr842n-v2)
  93. ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth0"
  94. ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x04"
  95. ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x08"
  96. ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x10"
  97. ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x02"
  98. ;;
  99. tplink,tl-wr841-v9|\
  100. tplink,tl-wr841-v11)
  101. ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth0"
  102. ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x10"
  103. ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x08"
  104. ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x04"
  105. ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x02"
  106. ;;
  107. ubnt,bullet-m|\
  108. ubnt,bullet-m-xw|\
  109. ubnt,nano-m|\
  110. ubnt,rocket-m)
  111. ucidef_set_rssimon "wlan0" "200000" "1"
  112. ucidef_set_led_rssi "rssilow" "RSSILOW" "ubnt:red:link1" "wlan0" "1" "100"
  113. ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "ubnt:orange:link2" "wlan0" "26" "100"
  114. ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "ubnt:green:link3" "wlan0" "51" "100"
  115. ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "ubnt:green:link4" "wlan0" "76" "100"
  116. ;;
  117. ubnt,nanostation-ac)
  118. ucidef_set_rssimon "wlan0" "200000" "1"
  119. ucidef_set_led_rssi "rssilow" "RSSILOW" "ubnt:blue:rssi0" "wlan0" "1" "100"
  120. ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "ubnt:blue:rssi1" "wlan0" "26" "100"
  121. ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "ubnt:blue:rssi2" "wlan0" "51" "100"
  122. ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "ubnt:blue:rssi3" "wlan0" "76" "100"
  123. ;;
  124. wd,mynet-wifi-rangeextender)
  125. ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth0"
  126. ucidef_set_rssimon "wlan0" "200000" "1"
  127. ucidef_set_led_rssi "rssilow" "RSSILOW" "$boardname:rssi-low" "wlan0" "1" "100"
  128. ucidef_set_led_rssi "rssimedium" "RSSIMED" "$boardname:blue:rssi-med" "wlan0" "33" "100"
  129. ucidef_set_led_rssi "rssihigh" "RSSIMAX" "$boardname:blue:rssi-max" "wlan0" "66" "100"
  130. ;;
  131. esac
  132. board_config_flush
  133. exit 0