Yes it was a bad pase, here is the script (unles you meant something else):
#!/bin/sh
BTN=/dev/input/event0
while true; do
BTNVAL=`hexdump -e '8/2 "%x " "\n"' -n 16 $BTN | grep ' 74 ' | awk
'{print $7}'`
if [ "$BTNVAL" = "1" ]
then
echo "Power button pressed"
/sbin/sync
/sbin/sync
/sbin/shutdown -h now
/sbin/shutdown -h now
exit
fi
sleep 1
done
W dniu 2014-10-02 18:28, Don deJuan pisze:
On 10/02/2014 08:09 AM, bremenpl wrote:
Also I forgot to mention, that in the script I actually have to put
the line /sbin/shutdown -h now twice... Otherwise after I press the
button the message that the system is going down is displayed, but
the system is not turning off. Then I press it again and its going down.
W dniu czwartek, 2 października 2014 17:03:23 UTC+2 użytkownik
bremenpl napisał:
Hello there,
I am using Console version of debian provided on elinux.org
<http://elinux.org> on BeagleBone Black. My problem is that it
misses the power button functionality. I have found this script
for handling it:
|
#!/bin/sh
BTN=/dev/input/event0
whiletrue;do
BTNVAL=`hexdump -e '8/2 "%x " "\n"' -n 16 $BTN | grep ' 74 ' |
awk '{print $7$
if [ "$BTNVAL" = "1" ]
then
echo "Power button pressed"
/sbin/sync
/sbin/sync
/sbin/shutdown -h now
exit
fi
sleep 1
done
|
I have put a link to it into init.d and used update-rc to make it
work at startup.
The problem is that it doesnt always work. Im not sure either it
is running in the background or not, because when i use ps
command i dont see the script running and even though the power
button works. So lets say every 3rd power up the power button
doesnt work... Im not sure whats the case. I would also
aprichiate if someone told me either this is the proper way of
handling the power button in the official bigger image.
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google
Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it,
send an email to [email protected]
<mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.
There is problems with the script, not sure if it was a bad paste or not.
Look at your BTNVAL
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the
Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/beagleboard/MAJFbngAJLA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
[email protected]
<mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.
--
Bremenpl
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.