added op_power, untested!
authorvimacs <vimacs@pndtest>
Sat, 26 Dec 2009 21:14:48 +0000 (22:14 +0100)
committervimacs <vimacs@pndtest>
Sat, 26 Dec 2009 21:14:48 +0000 (22:14 +0100)
new file:   testdata/scripts/op_power.sh

testdata/scripts/op_power.sh [new file with mode: 0644]

diff --git a/testdata/scripts/op_power.sh b/testdata/scripts/op_power.sh
new file mode 100644 (file)
index 0000000..a28c9a1
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/bash
+#actions done when the menu button is pressed
+#only argument is the time the button was pressed in  seconds
+
+if [ "$1" -le "1" ]; then #button was pressed 1 sec or less, resume
+  pndrunning=$(pstree -lpA | grep pnd_run.sh | sed -ne 's/.*(\([0-9]\+\))/\1/p')
+  for PID in $pidlist
+  do
+    kill -18 $PID #send SIGCONT
+  done
+  /usr/pandora/scripts/op_cpuspeed 500
+elif [ "$1" -le "3" ]; then # button was pressed 1-3sec, "suspend"
+  pndrunning=$(pstree -lpA | grep pnd_run.sh | sed -ne 's/.*(\([0-9]\+\))/\1/p')
+  for PID in $pidlist
+  do
+    kill -19 $PID #send SIGSTOP
+  done
+  /usr/pandora/scripts/op_cpuspeed 13
+elif [ "$1" -ge "3" ]; then #button was pressed 3 sec or longer, shutdown
+  shutdown -h now
+fi
+