summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-laptop/i8kutils/files/i8k.init')
-rw-r--r--app-laptop/i8kutils/files/i8k.init47
1 files changed, 47 insertions, 0 deletions
diff --git a/app-laptop/i8kutils/files/i8k.init b/app-laptop/i8kutils/files/i8k.init
new file mode 100644
index 000000000000..92b2d991589b
--- /dev/null
+++ b/app-laptop/i8kutils/files/i8k.init
@@ -0,0 +1,47 @@
+#!/sbin/runscript
+
+depend() {
+ after alsasound
+ after modules
+}
+
+checkconfig() {
+ if [ ! -e /proc/i8k ] ; then
+ eerror "The i8k driver is not installed"
+ return 1
+ fi
+}
+
+start() {
+ checkconfig || return 1
+ if [ -n "$VOLUME_UP$VOLUME_DOWN$VOLUME_MUTE" ] ; then
+ ebegin "Starting i8kbuttons"
+ start-stop-daemon --start --quiet --pidfile /var/run/i8kbuttons.pid \
+ --make-pidfile --exec /usr/bin/i8kbuttons --background \
+ -- ${VOLUME_UP:+-u "${VOLUME_UP}"} \
+ ${VOLUME_DOWN:+-d "$VOLUME_DOWN"} \
+ ${VOLUME_MUTE:+-m "$VOLUME_MUTE"} \
+ ${BUTTON_REPEAT:+-r "$BUTTON_REPEAT"}
+ eend $?
+ fi
+ if [ ! -n "$NOMON" ]; then
+ ebegin "Starting i8kmon"
+ start-stop-daemon --start --quiet --pidfile /var/run/i8kmon.pid \
+ --make-pidfile --exec /usr/bin/i8kmon --background \
+ -- -d ${NOAUTO:+-na} ${TIMEOUT:+-t $TIMEOUT}
+ eend $?
+ fi
+}
+
+stop() {
+ if [ -n "$VOLUME_UP$VOLUME_DOWN$VOLUME_MUTE" ] ; then
+ ebegin "Stopping i8kbuttons"
+ start-stop-daemon --stop --quiet --pidfile /var/run/i8kbuttons.pid
+ eend $?
+ fi
+ if [ ! -n "$NOMON" ]; then
+ ebegin "Stopping i8kmon"
+ start-stop-daemon --stop --quiet --pidfile /var/run/i8kmon.pid
+ eend $?
+ fi
+}