blob: 0b228e2d3268fdb9f4ae9513e32575ee04eaf732 [file] [log] [blame]
Jan Kundrát288f6af2018-09-21 14:58:04 +02001#!/bin/bash
2
3LEDS=(NONE status:{red,green,blue} uid:{red,green,blue} line:{red,green,blue} sfp:{red,green,blue})
4
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