mirror of https://github.com/hak5/shark-files.git
do not override user led in ARMING mode
arming mode basically sits in idle mode all the time, which means led status is set once per second. this makes it impossible to set user led status in arming mode (testing, development, whatever). Add a simple check to not override user set led status.pull/4/head
parent
ca54f29c7f
commit
55c0f683ca
|
@ -197,16 +197,19 @@ function enter_idle_mode() {
|
|||
while true
|
||||
do
|
||||
if [[ $MODE = "ARMING" ]] || [[ $MODE = "OFF" ]]; then
|
||||
#ARMING mode is basically always idle which means this overrides user LED
|
||||
#status once per second. Don't override user status with idle status.
|
||||
#pgrep LED > /dev/null || /usr/bin/LED whatever
|
||||
BATTERY_STATE=$(/usr/bin/BATTERY)
|
||||
case $BATTERY_STATE in
|
||||
"charging")
|
||||
/usr/bin/LED B SLOW
|
||||
pgrep LED > /dev/null || /usr/bin/LED B SLOW
|
||||
;;
|
||||
"full")
|
||||
/usr/bin/LED B
|
||||
pgrep LED > /dev/null || /usr/bin/LED B
|
||||
;;
|
||||
*)
|
||||
/usr/bin/LED Y SLOW
|
||||
pgrep LED > /dev/null || /usr/bin/LED Y SLOW
|
||||
if [[ $MODE = "OFF" ]]; then
|
||||
sleep 2 && halt
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue