~ubuntu-branches/ubuntu/jaunty/g15daemon/jaunty

« back to all changes in this revision

Viewing changes to debian/g15daemon.init

  • Committer: Bazaar Package Importer
  • Author(s): Giacomo Catenazzi
  • Date: 2007-10-09 13:28:56 UTC
  • Revision ID: james.westby@ubuntu.com-20071009132856-n082blwqi3krige2
Tags: 1.9.0-wip.20070910-5
* change priority to "extra"
* force libg15render-dev versioned dependencies

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh
 
2
 
 
3
### BEGIN INIT INFO
 
4
# Provides:          g15daemon
 
5
# Required-Start:    $local_fs
 
6
# Required-Stop:     $local_fs
 
7
# Should-Start:      $remote_fs
 
8
# Should-Stop:       $remote_fs
 
9
# Default-Start:     2 3 4 5
 
10
# Default-Stop:      0 1 6
 
11
# Short-Description: load deamon for Logitech G15 keyboard lcd display
 
12
# Description:       load deamon for Logitech G15 keyboard lcd display
 
13
### END INIT INFO
 
14
 
 
15
 
 
16
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
 
17
DAEMON=/usr/sbin/g15daemon
 
18
NAME=g15daemon
 
19
DESC=g15daemon
 
20
 
 
21
test -x $DAEMON || exit 0
 
22
 
 
23
# Include g15daemon defaults if available
 
24
if [ -f /etc/default/g15daemon ] ; then
 
25
        . /etc/default/g15daemon
 
26
fi
 
27
 
 
28
if [ "$SWITCH_KEY" = "L1" ]; then
 
29
        DAEMON_OPTS="-s $DAEMON_OPTS"
 
30
fi
 
31
 
 
32
set -e
 
33
 
 
34
case "$1" in
 
35
  start)
 
36
        echo -n "Starting $DESC: "
 
37
        start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
 
38
                --exec $DAEMON -- $DAEMON_OPTS
 
39
        echo "$NAME."
 
40
        ;;
 
41
  stop)
 
42
        echo -n "Stopping $DESC: "
 
43
        $DAEMON -k
 
44
        start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
 
45
                --exec $DAEMON
 
46
        echo "$NAME."
 
47
        ;;
 
48
  #reload)
 
49
        #
 
50
        #       If the daemon can reload its config files on the fly
 
51
        #       for example by sending it SIGHUP, do it here.
 
52
        #
 
53
        #       If the daemon responds to changes in its config file
 
54
        #       directly anyway, make this a do-nothing entry.
 
55
        #
 
56
        # echo "Reloading $DESC configuration files."
 
57
        # start-stop-daemon --stop --signal 1 --quiet --pidfile \
 
58
        #       /var/run/$NAME.pid --exec $DAEMON
 
59
  #;;
 
60
  force-reload)
 
61
        #
 
62
        #       If the "reload" option is implemented, move the "force-reload"
 
63
        #       option to the "reload" entry above. If not, "force-reload" is
 
64
        #       just the same as "restart" except that it does nothing if the
 
65
        #   daemon isn't already running.
 
66
        # check wether $DAEMON is running. If so, restart
 
67
        start-stop-daemon --stop --test --quiet --pidfile \
 
68
                /var/run/$NAME.pid --exec $DAEMON \
 
69
        && $0 restart \
 
70
        || exit 0
 
71
        ;;
 
72
  restart)
 
73
    echo -n "Restarting $DESC: "
 
74
        start-stop-daemon --stop --quiet --pidfile \
 
75
                /var/run/$NAME.pid --exec $DAEMON
 
76
        sleep 1
 
77
        start-stop-daemon --start --quiet --pidfile \
 
78
                /var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS
 
79
        echo "$NAME."
 
80
        ;;
 
81
  *)
 
82
        N=/etc/init.d/$NAME
 
83
        # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
 
84
        echo "Usage: $N {start|stop|restart|force-reload}" >&2
 
85
        exit 1
 
86
        ;;
 
87
esac
 
88
 
 
89
exit 0