blob: 27e31ce2e7edef113636e15c6296a1252b72d1c4 [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
15 echo 255 > "/sys/class/leds/${LEDS[$NUM]}/brightness"
16 fi
17 sleep 0.3
18done