op_power.sh: fix lockfile usage
[openpandora.oe.git] / recipes / pandora-system / pandora-scripts / op_power.sh
index cc290aa..25ca48a 100644 (file)
@@ -2,7 +2,9 @@
 
 . /usr/pandora/scripts/op_paths.sh
 
-( test -e /tmp/op_power.lock && exit 2 ) || touch "/tmp/op_power.lock"
+# XXX: better use lockfile (or something), but it's not in current firmware
+test -e /tmp/op_power.lock && exit 2
+touch /tmp/op_power.lock
 
 debug(){
        return 1 # 0 when debugging, 1 when not
@@ -173,4 +175,4 @@ elif [[ "$2" == "lid" ]]; then
 debug && echo "powerstate=$powerstate"
 echo "$powerstate" > /tmp/powerstate
 
-
+rm -f /tmp/op_power.lock