#!/bin/sh
# Start/stop/restart keytouch:

# Start keytouch:
keytouch_start() {
  if [ -x /usr/bin/keytouch ]; then
    echo "Starting keytouch: "
    /usr/bin/keytouch-acpid &
    /usr/bin/keytouch-init &
  fi
}

# Stop keytouch:
keytouch_stop() {
  killall keytouch-init
  killall keytouch-acpid
}

# Restart keytouch:
keytouch_restart() {
  keytouch_stop
  sleep 1
  keytouch_start
}

case "$1" in
'start')
  keytouch_start
  ;;
'stop')
  keytouch_stop
  ;;
'restart')
  keytouch_restart
  ;;
*)
  echo "usage rc.keytouch: start|stop|restart"
esac
