ioemu/src/disp-relay

19 lines
439 B
Plaintext
Raw Normal View History

2018-01-28 16:42:13 +00:00
#!/bin/bash
# (1) Declare association state <-> color_id
#--------------------------------------------------------#
# (1) Create associative array #
declare -A COLCODE;
# (2) States #
COLCODE[0]=90;
COLCODE[1]=32;
# (2) Check argument + display led
#--------------------------------------------------------#
# (1) Check argument #
test $# -ge 1 && state="$1" || state="0";
# (2) Display led #
echo -e "\e[${COLCODE[$state]}m⏺\e[0m";