#!/bin/sh # # celsiusHFix This scripts starts hotplug again to fix a bug with the hid # bluetooth keyboard/mouse (needs kernel >2.4.18 and USB-UHCI usb-hostcontrol modul) # Sa.W ### BEGIN INIT INFO # Provides: celsiusHFix # Required-Start: splash_late xdm # Required-Stop: # Default-Start: 2 3 5 # Default-Stop: # Description: Restarting hotplugging services in case of Celsius H ### END INIT INFO . /etc/rc.status # Determine the base and follow a runlevel link name. base=${0##*/} link=${base#*[SK][0-9][0-9]} # Force execution if not called by a runlevel directory. #test $link = $base && START_HOTPLUG=yes #test "$START_HOTPLUG" = yes || exit 0 case "$1" in start|restart) modprobe mousedev echo -e -n "Restarting hotplugging services in case of Celsius H [" # wait for xconsole count=0 res=`ps -ep 1 | grep kdm_greet` while test -z "$res" ; do sleep 1 res=`ps -ep 1 | grep kdm_greet` count=`expr $count + 1` if [ $count -gt 30 ]; then break fi done sleep 5 res=`lsmod | grep "^hid"` if test $? -eq 0 ; then rmmod hid echo -n "-HID-" sleep 2 modprobe hid fi sleep 2 res=`lsmod | grep "^hid"` if test $? -eq 0 ; then rmmod hid echo -n " -HID-" sleep 2 modprobe hid fi echo -n " ]" rc_status -v -r ;; stop) rc_status -v -r ;; *) echo $"Usage: $0 {start|stop|restart}" exit 1 ;; esac