From a85c9c4366c556c7d765ffbd68fd456b49ca4713 Mon Sep 17 00:00:00 2001 From: Michael Mrozek Date: Thu, 14 Mar 2013 05:06:22 +0100 Subject: [PATCH] op_bluetooth_work.sh: Modify LED enable / disable - code to work properly with the new LED-Settings --- .../pandora-scripts/op_bluetooth_work.sh | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) mode change 100755 => 100644 recipes/pandora-system/pandora-scripts/op_bluetooth_work.sh diff --git a/recipes/pandora-system/pandora-scripts/op_bluetooth_work.sh b/recipes/pandora-system/pandora-scripts/op_bluetooth_work.sh old mode 100755 new mode 100644 index 26c5e5c..25cb3b5 --- a/recipes/pandora-system/pandora-scripts/op_bluetooth_work.sh +++ b/recipes/pandora-system/pandora-scripts/op_bluetooth_work.sh @@ -21,12 +21,29 @@ if [ "$1" = "1" ]; then echo 0 > /sys/class/gpio/gpio15/value exit 1 fi - echo 255 > '/sys/class/leds/pandora::bluetooth/brightness' + if [ -e /sys/class/leds/ ] ; then + for led in /sys/class/leds/* ; do + trigger=$(grep "$(basename $led)" /etc/default/leds | grep bluetooth | \ + awk '{print $2}' ) + if [ "$trigger" = "bluetooth" ] ; then + echo default-on > "$led/trigger" + echo 255 > "$led/brightness" + fi + done + fi exit 0 elif [ "$1" = "0" ]; then killall hciattach echo 0 > /sys/class/gpio/gpio15/value - echo 0 > '/sys/class/leds/pandora::bluetooth/brightness' + if [ -e /sys/class/leds/ ] ; then + for led in /sys/class/leds/* ; do + trigger=$(grep "$(basename $led)" /etc/default/leds | grep bluetooth | \ + awk '{print $2}' ) + if [ "$trigger" = "bluetooth" ] ; then + echo 0 > "$led/brightness" + fi + done + fi echo 10 > /sys/devices/platform/omap_uart.0/sleep_timeout exit 0 else -- 2.39.2