Jan Kundrát | 288f6af | 2018-09-21 14:58:04 +0200 | [diff] [blame] | 1 | #!/bin/bash |
2 | |||||
Jan Kundrát | 51c34e1 | 2019-04-04 21:00:19 +0200 | [diff] [blame] | 3 | LEDS=(NONE led5:{red,green,blue} status:{red,green,blue} uid:{red,green,blue} line:{red,green,blue} sfp:{red,green,blue} port1:{red,green} port2:{red,green} port3:{red,green} port4:{red,green} port5:{red,green} port6:{red,green} port7:{red,green} port8:{red,green}) |
Jan Kundrát | 288f6af | 2018-09-21 14:58:04 +0200 | [diff] [blame] | 4 | |
5 | LAST=${#LEDS[@]} | ||||
6 | let "LAST2 = $LAST - 1" | ||||
7 | echo $LAST2 | ||||
8 | |||||
9 | for NUM in $(seq 1 ${LAST}); do | ||||
10 | let "PREVIOUS = $NUM - 1" | ||||
11 | if [[ $PREVIOUS -ne NONE ]]; then | ||||
12 | echo 0 > "/sys/class/leds/${LEDS[$PREVIOUS]}/brightness" | ||||
13 | fi | ||||
14 | if [[ $NUM -ne $LAST ]]; then | ||||
15 | echo 255 > "/sys/class/leds/${LEDS[$NUM]}/brightness" | ||||
16 | fi | ||||
17 | sleep 0.3 | ||||
18 | done |