blob: d09d8bc2541120445c2382a88097a6bff5c46d2e [file] [log] [blame]
Jan Kundrát288f6af2018-09-21 14:58:04 +02001#!/bin/bash
2
Jan Kundrát51c34e12019-04-04 21:00:19 +02003LEDS=(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át288f6af2018-09-21 14:58:04 +02004
5LAST=${#LEDS[@]}
6let "LAST2 = $LAST - 1"
7echo $LAST2
8
9for 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
Jan Kundrát8fe28fb2020-09-04 11:02:59 +020015 echo 256 > "/sys/class/leds/${LEDS[$NUM]}/brightness"
Jan Kundrát288f6af2018-09-21 14:58:04 +020016 fi
17 sleep 0.3
18done