rename service.sh to moonlight.sh and fix spacing

This commit is contained in:
Lukas Rusak 2016-05-05 00:26:06 -07:00
parent c8dc3eb0de
commit ceb7ce5b90
1 changed files with 13 additions and 20 deletions

View File

@ -4,13 +4,8 @@
oe_setup_addon script.moonlight
chmod a+x $ADDON_DIR/bin/*
while [ 1 ]
do
if [ -f $ADDON_DIR/start_moonlight.tmp ]
then
oe_setup_addon script.moonlight
while [ 1 ]; do
if [ -f $ADDON_DIR/start_moonlight.tmp ]; then
MOONLIGHT_APP=`cat $ADDON_DIR/start_moonlight.tmp`
@ -65,7 +60,7 @@ do
fi
if [ "$MOON_MAPPING" != "" ]; then
MOONLIGHT_ARG="$MOONLIGHT_ARG -mapping \"${ADDON_DIR}/bin/mappings/${MOON_MAPPING}.conf\""
MOONLIGHT_ARG="$MOONLIGHT_ARG -mapping \"${ADDON_DIR}/share/moonlight/mappings/${MOON_MAPPING}.conf\""
fi
if [ "$MOONLIGHT_APP" != "" ]; then
@ -78,17 +73,15 @@ do
MOONLIGHT_ARG="$MOONLIGHT_ARG $MOON_SERVER_IP"
fi
if pgrep "kodi.bin" > /dev/null
then
if pgrep "kodi.bin" > /dev/null; then
systemctl stop kodi
fi
modprobe snd_bcm2835
modprobe snd_bcm2835 || :
echo $MOONLIGHT_ARG >> $ADDON_LOG_FILE
/bin/sh -c "${ADDON_DIR}/bin/moonlight ${MOONLIGHT_ARG} > ${ADDON_LOG_FILE} 2>&1"
rmmod snd_bcm2835
rmmod snd_bcm2835 || :
systemctl start kodi
fi
sleep 1
done