From: vimacs Date: Thu, 18 Feb 2010 15:20:25 +0000 (+0100) Subject: check if statefile exists X-Git-Tag: Release-2010-05/1~110 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=12baaa4358b3af2d01101ab8d5680348b1a40d2b;p=pandora-libraries.git check if statefile exists modified: testdata/scripts/op_power.sh --- 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)