File: keytouchd-launch

package info (click to toggle)
keytouch 2.3.2-2.1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 4,480 kB
  • ctags: 1,475
  • sloc: ansic: 9,591; sh: 4,008; makefile: 466; perl: 75
file content (39 lines) | stat: -rw-r--r-- 813 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
# This script was written by Daniele Favara <danjele@gmail.com>
# Stripped for keytouch by Rodrigo Gallardo <rodrigo@nul-unu.com>

set -e

while [ ! -z "$1" ];do
    case "$1" in
      --help|-h)
	    echo "Usage: keytouchd-launch [command]"
            echo "Launch the keytouch daemons in background, before running COMMAND."
            echo "Please see 'man keytouchd-launch' for details."
        exit 
        ;;
      *)
        SESSION=$@ ; shift $#
        ;;
    esac
done


if [ "x$SESSION" = "x" ]; then
    # No session? We die
    echo "You must provide a command to run."
    exit 1
else
    keytouchd & keytouchdpid=$!

    # Run the session, kill the daemons afterwards
    $SESSION 

    while ps $keytouchdpid 
      do
      kill $keytouchdpid || sleep 5
    done

    exit $?
fi