File: keytouch.init

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 (59 lines) | stat: -rw-r--r-- 1,852 bytes parent folder | download
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/sh
# keytouch - a program to configure the extra function keys of the keyboard
### BEGIN INIT INFO
# Provides:          keytouch
# Required-Start:    $local_fs $remote_fs
# Required-Stop:     $local_fs $remote_fs
# Should-Start:      
# Should-Stop:       
# Default-Start:     2
# Default-Stop:      0 6
# Short-Description: Initialize extra function keys in multimedia keyboards
# Description:       Initializes kernel keymappings for multimedia keyboard's
#                    extra function keys. This mappings are used by the keytouch
#                    daemon inside an X session to assign actions to those keys.
#                    It also initializes resending of ACPID keypresses as events
#                    for keytouchd.
### END INIT INFO

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/bin/keytouch-init
ACPID_DAEMON=/usr/bin/keytouch-acpid
KEYBOARD_FILE=/etc/keytouch/current_keyboard.xml
NAME=keytouch-init
DESC=keytouch

set -e

test -x $DAEMON || exit 0
test -f $KEYBOARD_FILE || exit 0

case "$1" in
  start)
	echo -n "Initializing $DESC:"
	echo -n " keytouch-init";  start-stop-daemon --start --quiet --oknodo --exec $DAEMON
        echo -n " keytouch-acpid"; start-stop-daemon --start --quiet --oknodo --background --exec $ACPID_DAEMON
	echo "."
	;;
  stop)
        echo -n "Stopping $DESC:"
        # Try to stop keytouch-acpid only if it is running
        if /sbin/start-stop-daemon --stop --test --quiet --exec $ACPID_DAEMON; then  
            echo -n " keytouch-acpid"; start-stop-daemon --stop --quiet --exec $ACPID_DAEMON
            echo "."
        else
            echo " nothing to do."
        fi
	;;
  restart|force-reload)
        $0 stop
        $0 start
        ;;
  *)
	N=/etc/init.d/$NAME
	echo "Usage: $N {start|stop|restart|force-reload}" >&2
	exit 1
	;;
esac

exit 0