From 12baaa4358b3af2d01101ab8d5680348b1a40d2b Mon Sep 17 00:00:00 2001 From: vimacs Date: Thu, 18 Feb 2010 16:20:25 +0100 Subject: [PATCH] check if statefile exists modified: testdata/scripts/op_power.sh --- testdata/scripts/op_power.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/testdata/scripts/op_power.sh b/testdata/scripts/op_power.sh index d6d4fa5..98354b3 100755 --- a/testdata/scripts/op_power.sh +++ b/testdata/scripts/op_power.sh @@ -3,8 +3,12 @@ #only argument is the time the button was pressed in seconds if [ "$1" -le "3" ]; then # button was pressed 1-3sec, "suspend" - powerstate=$(cat /tmp/powerstate) - if [$powerstate -eq "1" ]; then + if [ -e /tmp/powerstate ]; then + powerstate=$(cat /tmp/powerstate) + else + powerstate=0 + fi + if [$powerstate -eq 1 ]; then #in lowpower mode echo 0 > /tmp/powerstate oldbright=$(cat /tmp/oldbright) -- 2.39.5