~brian-murray/apport/test-fix

« back to all changes in this revision

Viewing changes to pm-utils/sleep.d/000record-status

  • Committer: Martin Pitt
  • Date: 2009-11-24 12:24:07 UTC
  • Revision ID: martin.pitt@canonical.com-20091124122407-zpc04nnn4t1l1gi7
Add pm-utils hook to record current operation, so that apportcheckresume can check it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
#
 
3
# Record the current operation to allow failure detection.
 
4
 
 
5
STAMPFILE="/var/lib/pm-utils/status"
 
6
 
 
7
case "$1" in
 
8
       hibernate|suspend)
 
9
               mkdir -p `dirname $STAMPFILE`
 
10
               echo "$1" >"$STAMPFILE"
 
11
               ;;
 
12
       thaw|resume) 
 
13
               rm -f "$STAMPFILE"
 
14
               ;;
 
15
esac
 
16