summaryrefslogtreecommitdiff
blob: b31ccb9d7fc862ab2df03e21fcfbee3f32cb4489 (plain)
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
#!/sbin/runscript
# Copyright 1999-2006 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.5.initd,v 1.1 2006/11/13 23:18:01 jokey 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 && ! -e /dev/input/uinput ]] ; then
		# We can load modules, but uinput device does not exist
		einfo "Loading uinput module"
		/sbin/modprobe uinput &> /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"
	start-stop-daemon --stop --quiet --pidfile /var/run/g15daemon.pid
	eend $?
}