Sophie

Sophie

distrib > Mageia > 5 > i586 > media > core-release > by-pkgid > 396a6b427378a944a98363b9b2c1b2df > files > 1

g15daemon-1.9.5.3-11.mga5.i586.rpm

#!/bin/sh
#
# g15daemon:   Provides access to extra keys and the LCD available on the logitech G15 keyboard
#
# chkconfig: 345 25 60
# description: G15Daemon allows users access to all extra keys by decoding \
#              them and pushing them back into the kernel via the linux \
#              UINPUT driver. This driver must be loaded before g15daemon can \
#              be used for keyboard access. \
#              The G15 LCD is also supported. By default, with no other \
#              clients active, g15daemon will display a clock. Client \
#              applications and scripts can access the LCD via a simple API.
#
# processname: g15daemon
# pidfile: /var/run/g15daemon.pid
#
### BEGIN INIT INFO
# Provides: g15daemon
# Required-Start:
# Required-Stop:
# Default-Start: 3 4 5
# Short-Description: Provides access to extra keys and the LCD available on the logitech G15 keyboard
# Description: G15Daemon allows users access to all extra keys by decoding
#              them and pushing them back into the kernel via the linux
#              UINPUT driver. This driver must be loaded before g15daemon can
#              be used for keyboard access.
#              The G15 LCD is also supported. By default, with no other
#              clients active, g15daemon will display a clock. Client
#              applications and scripts can access the LCD via a simple API.
### END INIT INFO

# Sanity checks.
[ -x /usr/sbin/g15daemon ] || exit 0

# Source function library.
. /etc/rc.d/init.d/functions

RETVAL=0

start() {
    gprintf "Starting G15 Daemon: "
    daemon g15daemon
    RETVAL=$?
    echo
    [ $RETVAL -eq 0 ] && touch /var/lock/subsys/g15daemon
}

stop() {
    gprintf "Stopping G15 Daemon: "
    killproc g15daemon -TERM
    RETVAL=$?
    echo
    if [ $RETVAL -eq 0 ]; then
        rm -f /var/lock/subsys/g15daemon
        rm -f /var/run/g15daemon.pid
    fi
}

reload()  {
    gprintf "Reloading G15 Daemon: "
    killproc g15daemon -HUP
    RETVAL=$?
    echo
}

# See how we were called.
case "$1" in
    start)
        start
        ;;
    stop)
        stop
        ;;
    status)
        status g15daemon
        RETVAL=$?
        ;;
    restart)
        stop
        start
        ;;
    condrestart)
        if [ -f /var/lock/subsys/g15daemon ]; then
            stop
            start
        fi
        ;;
    reload)
        reload
        ;;
    *)
        gprintf "Usage: %s {start|stop|status|restart|condrestart|reload}\n" "$0"
        ;;
esac
exit $RETVAL