openwrt-redmi-ax3000/target/linux/ipq50xx/base-files/etc/board.d/01_leds
2024-07-20 00:04:10 +08:00

33 lines
450 B
Bash
Executable File

#!/bin/sh
. /lib/functions/uci-defaults.sh
bits() {
local val
val=0
while [ -n "$1" ]; do
val=$(( val | (1 << $1) ))
shift 1
done
printf "0x%x" "$val"
}
board_config_update
board=$(board_name)
case $board in
redmi,ax3000)
ucidef_set_led_switch "wan" "WAN" "blue:internet" "switch1" "$( bits 4 )"
;;
xiaomi,cr881x)
ucidef_set_led_switch "wan" "WAN" "blue:internet" "switch0" "$( bits 3 )"
;;
esac
board_config_flush
exit 0