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
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
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