#!/bin/bash
#
#       /etc/rc.*
#
# Source function library.
#. /etc/init.d/functions
### BEGIN INIT INFO
# Provides:            CTUtil
# Required-Start:      $ALL
# Required-Stop:       
# Should-Start:        
# Should-Stop:         
# Default-Start:       1 2 3 4 5
# Default-Stop:        
# Short-Description:   CoolTouch user mode driver
# Description:         Start CTUtil to provide mouse emulation service.
### END INIT INFO

#modprobe uinput;
if test -s /etc/rc.status
then . /etc/rc.status
else exit 1
fi

start() {
        echo -n "Starting ct_util..."

	/sbin/startproc /opt/weida/ct_run
	rc_status -v
        return
}

stop() {
        echo -n "Shutting down ct_util..."

	/sbin/killproc /opt/weida/ct_util
	rc_status -v

        return
}

case "$1" in
    start)
        start
        ;;
    stop)
        stop
        ;;
    restart)
        stop
        start
        ;;
    *)
        echo "Usage:  {start|stop|restart}"
        exit 1
        ;;
esac
exit $?
