Commit d6c44991 authored by Pavel Beketov's avatar Pavel Beketov

add blink_all_busy_slots.sh

parent 033fe23c
#!/bin/bash
SG=/dev/sg26
DURATION=30
BLINK_INTERVAL=1
# Собираем список занятых слотов
BUSY=$(sg_ses -p aes "$SG" | awk '
/Element index:/ {idx=$3}
/attached SAS address:/ {
if ($4!="0x0") print idx
}')
echo "Занятые слоты: $BUSY"
# Включаем индикацию
blink_on() {
for i in $BUSY; do
sg_ses --index="$i" --set=ident "$SG" >/dev/null 2>&1
done
}
# Выключаем индикацию
blink_off() {
for i in $BUSY; do
sg_ses --index="$i" --clear=ident "$SG" >/dev/null 2>&1
done
}
END=$((SECONDS + DURATION))
while [ $SECONDS -lt $END ]; do
blink_on
sleep $BLINK_INTERVAL
blink_off
sleep $BLINK_INTERVAL
done
# При выходе выключаем все
blink_off
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment