#!/bin/sh # # celsiusHFix This scripts starts hotplug again to fix a bug with the hid # bluetooth keyboard/mouse (needs kernel >2.4.18 and UHCI usb-hostcontrol modul) # ### BEGIN INIT INFO # Provides: celsiusHFix # Required-Start: splash_late # Required-Stop: # Default-Start: 2 3 5 # Default-Stop: # Description: Restarting hotplugging services in case of Celsius H ### END INIT INFO . /etc/rc.status . /etc/rc.config # 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) echo -e -n "Restarting hotplugging services in case of Celsius H [" # wait for xconsole count=0 res=`ps -ep 1 | grep xconsole` # echo $res while test -z "$res" ; do sleep 1 res=`ps -ep 1 | grep xconsole` # echo $res count=`expr $count + 1` if [ $count -gt 20 ]; then break fi done sleep 1 res=`lsmod | grep "^hid"` if test $? -eq 0 ; then rmmod hid sleep 1 fi RC=/etc/hotplug/usb.rc $RC restart sleep 5 $RC restart echo -n " ]" rc_status -v -r ;; stop) rc_status -v -r ;; *) echo $"Usage: $0 {start|stop|restart}" exit 1 ;; esac