--- hotkey-setup-0.1/debian/init.d 2008-06-15 22:33:20.000000000 +0200 +++ hotkey-setup-0.1/debian/init.d 2008-06-15 22:54:06.000000000 +0200 @@ -1,4 +1,4 @@ -#!/bin/bash +#!/sbin/runscript manufacturer=`dmidecode --string system-manufacturer` name=`dmidecode --string system-product-name` @@ -9,6 +9,7 @@ THINKPAD_PROC_HOTKEY=/proc/acpi/ibm/hotkey THINKPAD_KEYS=/usr/sbin/thinkpad-keys + do_video () { VIDEO=`sed -n -e '/^[ \t]*section[ \\t]*"device"/I,/^[ \t]*endsection/I{/^[ \t]*driver[ \t]*/I{s/^[ \t]*driver[ \t]*"*//I;s/"*[ \t]*$//;p}}' /etc/X11/xorg.conf` case $VIDEO in @@ -47,8 +48,7 @@ fi } -case "$1" in - start) +start() { # This entire block does nothing on desktops right now if laptop-detect; then @@ -148,17 +148,14 @@ esac . /usr/share/hotkey-setup/generic.hk fi - ;; - stop) - if [ -f $THINKPAD_LOCKFILE ]; then +} + +stop() { + if [ -f $THINKPAD_LOCKFILE ]; then kill `pidof thinkpad-keys` || true ; rm -f $THINKPAD_LOCKFILE fi if [ -f $SAVED_STATE ]; then setkeycodes $(cat $SAVED_STATE) || true fi - ;; - restart|force-reload) - $0 stop || true - $0 start - ;; -esac +} +