| 1 |
#!/bin/bash |
|---|
| 2 |
# |
|---|
| 3 |
# Script to start and stop wminput - (c) 2007 Pablo Catalina <xkill@ciberhell.ath.cx> |
|---|
| 4 |
# |
|---|
| 5 |
# This is free software; you can redistribute it and/or modify |
|---|
| 6 |
# it under the terms of the GNU General Public License as published by |
|---|
| 7 |
# the Free Software Foundation; either version 2 of the License, or |
|---|
| 8 |
# (at your option) any later version. |
|---|
| 9 |
# |
|---|
| 10 |
## BEGIN USER CONFIGURATION ## |
|---|
| 11 |
# |
|---|
| 12 |
# Set the always connect wait time |
|---|
| 13 |
WAIT_TIME=30 |
|---|
| 14 |
# Set the config file |
|---|
| 15 |
CONF="ir_ptr" |
|---|
| 16 |
# Set the mac of your wiimote |
|---|
| 17 |
WIIMOTE=00:19:1D:6E:77:83 |
|---|
| 18 |
# Set the logfile |
|---|
| 19 |
LOG=/tmp/wiimote.log |
|---|
| 20 |
## END USER CONFIGURATION ## |
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
case "$1" in |
|---|
| 24 |
'start') |
|---|
| 25 |
/usr/local/bin/wminput -a $WAIT_TIME -w -c $CONF $WIIMOTE -d |
|---|
| 26 |
;; |
|---|
| 27 |
'stop') |
|---|
| 28 |
killall wminput |
|---|
| 29 |
;; |
|---|
| 30 |
'restart') |
|---|
| 31 |
killall wminput |
|---|
| 32 |
sleep 1 |
|---|
| 33 |
/usr/local/bin/wminput -a $WAIT_TIME -w -c $CONF $WIIMOTE -d |
|---|
| 34 |
;; |
|---|
| 35 |
*) |
|---|
| 36 |
echo "usage $0 start|stop|restart" |
|---|
| 37 |
exit 1 ;; |
|---|
| 38 |
esac |
|---|
| 39 |
|
|---|
| 40 |
|
|---|