author | sandman <sandman> | 2002-06-02 01:42:05 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-06-02 01:42:05 (UTC) |
commit | 2205558adae76dc40a5c0f2dd83226a4d1c67eae (patch) (unidiff) | |
tree | e7e96aa694bab035c2c75f3c1b6dbceea07d4270 /core/opiealarm/opieatd | |
parent | 385a3d8034003a412fa73840bf985582bf6b4547 (diff) | |
download | opie-2205558adae76dc40a5c0f2dd83226a4d1c67eae.zip opie-2205558adae76dc40a5c0f2dd83226a4d1c67eae.tar.gz opie-2205558adae76dc40a5c0f2dd83226a4d1c67eae.tar.bz2 |
Reworked the whole system and introduced re-suspend. Effect is that the
iPAQ is re-suspended when woken up by the RTC (as opposed to the button)
and on AC. Timeout is currently hardcoded to 120sec.
-rwxr-xr-x | core/opiealarm/opieatd | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/core/opiealarm/opieatd b/core/opiealarm/opieatd index 3b9dc0e..fc2d421 100755 --- a/core/opiealarm/opieatd +++ b/core/opiealarm/opieatd | |||
@@ -4,2 +4,6 @@ timefile=/etc/resumeat | |||
4 | 4 | ||
5 | trap exit 0 SIGTERM SIGINT SIGQUIT | ||
6 | |||
7 | echo $$ >/var/run/opieatd.pid | ||
8 | |||
5 | mkdir -p /var/spool/at | 9 | mkdir -p /var/spool/at |
@@ -8,6 +12,6 @@ mkdir -p /var/spool/at | |||
8 | while true; do | 12 | while true; do |
9 | cat /var/spool/at/trigger | while read line; do | 13 | while read </var/spool/at/trigger dummy; do |
10 | FILE=`ls -1 /var/spool/at/[0-9]* | head -n1` | 14 | FILES=`ls /var/spool/at/[0-9]* 2>/dev/null` |
11 | echo "File = $FILE" | 15 | |
12 | if [ -z "$FILE" ]; then | 16 | if [ -z "$FILES" ]; then |
13 | echo "clear resume at" | 17 | echo "clear resume at" |
@@ -15,5 +19,15 @@ while true; do | |||
15 | else | 19 | else |
16 | unixtime=`basename $FILE | cut -c1-10` | 20 | for i in "$FILES"; do |
21 | echo "File = $i" | ||
22 | |||
23 | unixtime=`basename $i | cut -c1-10` | ||
24 | pid=`basename $i | cut -c12-` | ||
25 | |||
26 | if [ -d /proc/$pid ]; then | ||
17 | echo "Datestring = $unixtime" | 27 | echo "Datestring = $unixtime" |
18 | echo "$unixtime" >$timefile | 28 | echo "$unixtime" >$timefile |
29 | else | ||
30 | rm -f $i | ||
31 | fi | ||
32 | done | ||
19 | fi | 33 | fi |
@@ -22 +36,2 @@ done | |||
22 | 36 | ||
37 | exit 0 | ||