summaryrefslogtreecommitdiff
path: root/app-misc/g15daemon/files/g15daemon.initd
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss123next@list.ru>2010-09-16 16:10:41 +0300
committerGluzskiy Alexandr <sss123next@list.ru>2010-09-16 16:10:41 +0300
commitfc0cde0e2a18d234bcea5b396ff61761cbc6560c (patch)
treecdd2214d8d449bd711bb2490f1571bfb38e03e11 /app-misc/g15daemon/files/g15daemon.initd
parent5765bac9095a12ee28525fec1036ad926827b93b (diff)
quick and dirty ebuilds for my new keyboard (cource live from source repo)
Diffstat (limited to 'app-misc/g15daemon/files/g15daemon.initd')
-rw-r--r--app-misc/g15daemon/files/g15daemon.initd41
1 files changed, 41 insertions, 0 deletions
diff --git a/app-misc/g15daemon/files/g15daemon.initd b/app-misc/g15daemon/files/g15daemon.initd
new file mode 100644
index 0000000..b8e8cd6
--- /dev/null
+++ b/app-misc/g15daemon/files/g15daemon.initd
@@ -0,0 +1,41 @@
+#!/sbin/runscript
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-misc/g15daemon/files/g15daemon-1.2.7-r2.initd,v 1.1 2007/12/19 17:38:30 chainsaw Exp $
+
+# Init script for g15daemon
+
+depend() {
+ after hotplug
+ after usb
+ after modules
+}
+
+start() {
+ ebegin "Starting g15daemon"
+
+ # Does the input device already exist?
+ if [ -e /proc/modules -a ! -e /dev/input/uinput ]; then
+ # We can load modules, but uinput device does not exist
+ einfo "Loading uinput module"
+ /sbin/modprobe uinput > /dev/null 2> /dev/null
+ fi
+
+ local SWITCHKEY=""
+ [ "${CLIENT_SWITCH_L1}" = "yes" ] && SWITCHKEY="--switch"
+ start-stop-daemon --start --background --pidfile /var/run/g15daemon.pid \
+ --exec /usr/sbin/g15daemon -- ${SWITCHKEY}
+ eend $? "Failed to start g15daemon."
+}
+
+stop() {
+ ebegin "Stopping g15daemon"
+ local KILLOPT="-k"
+ if [ $BACKLIGHT_OFF = "yes" ]; then
+ KILLOPT="-K"
+ fi
+ /usr/sbin/g15daemon ${KILLOPT} &>/dev/null
+ sleep 1
+ start-stop-daemon -R 5 --stop --quiet --pidfile /var/run/g15daemon.pid
+ eend $?
+}