forked from benjie/MythPyWii
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmythpywii.conf
26 lines (21 loc) · 857 Bytes
/
mythpywii.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# mythpywii - Start the daemon for the wii to connect to
#
description "Start the daemon for the wii to connect to"
start on (local-filesystems
and started dbus)
stop on stopping dbus
script
if pgrep -f /usr/local/bin/myth_py_wii.py; then
pkill -f /usr/local/bin/myth_py_wii.py
fi
bluetooth_devices=$(lsusb |
grep "Broadcom Corp. BCM2046B1 USB 2.0 Hub" |
cut -d ':' -f 1 |
sed -e 's/^Bus \([0-9]\{3\}\) Device \([0-9]\{3\}\)$/\/dev\/bus\/usb\/\1\/\2/')
for usb in $bluetooth_devices; do
usbreset "$usb" | tee -a /var/log/mythpywii.log | logger
done
# It takes a second for the bluetooth devices come back up. I wonder if there's a better way to watch them, and start the job then, instead.
sleep 5
python /usr/local/bin/myth_py_wii.py >> /var/log/mythpywii.log 2>&1
end script