forked from opdenkamp/xbmc
/
xbmc-watchdog.sh
executable file
·49 lines (43 loc) · 963 Bytes
/
xbmc-watchdog.sh
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/sh
#USEHWR="A10HWR=1"
if [ -d /lib/arm-linux-gnueabihf ]
then
#assume linaro rootfs
USER=linaro
XBMC=/allwinner/xbmc-pvr-binhf/lib/xbmc/xbmc.bin
else
#assume miniand rootfs
USER=miniand
XBMC=/allwinner/xbmc-pvr-bin/lib/xbmc/xbmc.bin
fi
#
#some q&d to avoid editing system config files.
#
depmod -a `uname -r`
modprobe lcd
modprobe hdmi
modprobe ump
modprobe disp
modprobe mali
modprobe mali_drm
chmod 666 /dev/mali /dev/ump /dev/cedar_dev /dev/disp
chmod -R 666 /dev/input/*
chmod -R 666 /dev/snd/*
stop lightdm
#thanks, Sam Nazarko
while true
do
su - $USER -c "$USEHWR $XBMC --standalone -fs --lircdev /var/run/lirc/lircd 2>&1 | logger -t xbmc"
case "$?" in
0) # user quit.
sleep 2 ;;
64) # shutdown system.
poweroff;;
65) # warm Restart xbmc
sleep 2 ;;
66) # Reboot System
reboot;;
*) # this should not happen
sleep 30 ;;
esac
done