From: Michael Mrozek Date: Thu, 14 Mar 2013 04:06:22 +0000 (+0100) Subject: op_bluetooth_work.sh: Modify LED enable / disable - code to work properly with the... X-Git-Tag: sz_154~47 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a85c9c4366c556c7d765ffbd68fd456b49ca4713;p=openpandora.oe.git op_bluetooth_work.sh: Modify LED enable / disable - code to work properly with the new LED-Settings --- 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