~ubuntu-branches/debian/sid/prey/sid

« back to all changes in this revision

Viewing changes to modules/lock/core/functions

  • Committer: Bazaar Package Importer
  • Author(s): Alessio Treglia, Alessio Treglia, Christian Perrier
  • Date: 2011-04-08 10:05:52 UTC
  • mfrom: (2.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20110408100552-s0ht3su1pogh0ljx
Tags: 0.5.3-2
[ Alessio Treglia ]
* Upload to unstable.

[ Christian Perrier ]
* Debconf templates and debian/control reviewed by the debian-l10n-
  english team as part of the Smith review project. Closes: #617676
* [Debconf translation updates]
* Swedish (Martin Bagge / brother).  Closes: #618619
* Danish (Joe Hansen).  Closes: #618717
* French (Christian Perrier).  Closes: #618746
* Slovak (Ivan Masár).  Closes: #618843
* Russian (Yuri Kozlov).  Closes: #618867
* German (Chris Leick).  Closes: #618868
* Brazilian Portuguese (Flamarion Jorge).  Closes: #618908
* Finnish (Esko Arajärvi).  Closes: #618953
* cze ces cs Czech (Michal Simunek).  Closes: #619522
* Spanish; (Omar Campagne).  Closes: #619884

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 
8
8
# set -bm
9
9
 
 
10
before_lock_callback(){
 
11
        log " -- Running lock before callback."
 
12
}
 
13
 
 
14
after_lock_callback(){
 
15
        log " -- Running lock after callback."
 
16
}
 
17
 
10
18
activate_lock(){
11
19
 
12
 
        if [ -z `is_process_running 'prey-lock'` ]; then
13
 
                local command="\"$lock__executable\" `md5_hash_for $lock__unlock_pass`"
14
 
                run_as_current_user "$command" &
15
 
                # trap 'reactivate_lock' SIGCHLD
16
 
                pid=$!
17
 
                wait $pid
18
 
                rs=$?
19
 
                # echo  "return status was: $rs"
20
 
                if [ $rs == 0 ]; then
21
 
                        deactivate_modules_on_panel "lock"
22
 
                else
23
 
                        activate_lock
24
 
                fi
25
 
        else
 
20
        if [ -n "`is_process_running 'prey-lock'`" ]; then
26
21
                log ' -- Prey lock seems to be running already!'
27
 
        fi
 
22
                return 1
 
23
        fi
 
24
 
 
25
        before_lock_callback
 
26
        local command="\"$lock__executable\" `md5_hash_for $lock__unlock_pass`"
 
27
        run_as_current_user "$command" &
 
28
        # trap 'reactivate_lock' SIGCHLD
 
29
        pid=$!
 
30
        wait $pid
 
31
        rs=$?
 
32
        # echo  "return status was: $rs"
 
33
        if [ $rs -eq 66 ]; then
 
34
                deactivate_modules_on_panel "lock"
 
35
        elif [ $rs != 0 ]; then
 
36
                activate_lock
 
37
                return
 
38
        fi
 
39
        after_lock_callback
 
40
 
28
41
}