rename service.sh to moonlight.sh and fix spacing
This commit is contained in:
parent
c8dc3eb0de
commit
ceb7ce5b90
|
@ -4,18 +4,13 @@
|
||||||
|
|
||||||
oe_setup_addon script.moonlight
|
oe_setup_addon script.moonlight
|
||||||
|
|
||||||
chmod a+x $ADDON_DIR/bin/*
|
while [ 1 ]; do
|
||||||
|
if [ -f $ADDON_DIR/start_moonlight.tmp ]; then
|
||||||
|
|
||||||
while [ 1 ]
|
|
||||||
do
|
|
||||||
if [ -f $ADDON_DIR/start_moonlight.tmp ]
|
|
||||||
then
|
|
||||||
oe_setup_addon script.moonlight
|
|
||||||
|
|
||||||
MOONLIGHT_APP=`cat $ADDON_DIR/start_moonlight.tmp`
|
MOONLIGHT_APP=`cat $ADDON_DIR/start_moonlight.tmp`
|
||||||
|
|
||||||
rm $ADDON_DIR/start_moonlight.tmp
|
rm $ADDON_DIR/start_moonlight.tmp
|
||||||
|
|
||||||
MOONLIGHT_ARG="stream"
|
MOONLIGHT_ARG="stream"
|
||||||
|
|
||||||
if [ "$MOON_PACKETSIZE" != "0" ]; then
|
if [ "$MOON_PACKETSIZE" != "0" ]; then
|
||||||
|
@ -59,36 +54,34 @@ do
|
||||||
if [ "$MOON_REMOTE" = "true" ]; then
|
if [ "$MOON_REMOTE" = "true" ]; then
|
||||||
MOONLIGHT_ARG="$MOONLIGHT_ARG -remote"
|
MOONLIGHT_ARG="$MOONLIGHT_ARG -remote"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$MOON_AUDIO" != "sysdefault" ]; then
|
if [ "$MOON_AUDIO" != "sysdefault" ]; then
|
||||||
MOONLIGHT_ARG="$MOONLIGHT_ARG -audio $MOON_AUDIO"
|
MOONLIGHT_ARG="$MOONLIGHT_ARG -audio $MOON_AUDIO"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$MOON_MAPPING" != "" ]; then
|
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
|
fi
|
||||||
|
|
||||||
if [ "$MOONLIGHT_APP" != "" ]; then
|
if [ "$MOONLIGHT_APP" != "" ]; then
|
||||||
MOONLIGHT_ARG="$MOONLIGHT_ARG -app \"${MOONLIGHT_APP}\""
|
MOONLIGHT_ARG="$MOONLIGHT_ARG -app \"${MOONLIGHT_APP}\""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
MOONLIGHT_ARG="$MOONLIGHT_ARG -keydir \"${ADDON_HOME}/keys\""
|
MOONLIGHT_ARG="$MOONLIGHT_ARG -keydir \"${ADDON_HOME}/keys\""
|
||||||
|
|
||||||
if [ "$MOON_SERVER_IP" != "0.0.0.0" ]; then
|
if [ "$MOON_SERVER_IP" != "0.0.0.0" ]; then
|
||||||
MOONLIGHT_ARG="$MOONLIGHT_ARG $MOON_SERVER_IP"
|
MOONLIGHT_ARG="$MOONLIGHT_ARG $MOON_SERVER_IP"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if pgrep "kodi.bin" > /dev/null
|
if pgrep "kodi.bin" > /dev/null; then
|
||||||
then
|
|
||||||
systemctl stop kodi
|
systemctl stop kodi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
modprobe snd_bcm2835
|
modprobe snd_bcm2835 || :
|
||||||
echo $MOONLIGHT_ARG >> $ADDON_LOG_FILE
|
echo $MOONLIGHT_ARG >> $ADDON_LOG_FILE
|
||||||
/bin/sh -c "${ADDON_DIR}/bin/moonlight ${MOONLIGHT_ARG} > ${ADDON_LOG_FILE} 2>&1"
|
/bin/sh -c "${ADDON_DIR}/bin/moonlight ${MOONLIGHT_ARG} > ${ADDON_LOG_FILE} 2>&1"
|
||||||
rmmod snd_bcm2835
|
rmmod snd_bcm2835 || :
|
||||||
systemctl start kodi
|
systemctl start kodi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
Loading…
Reference in a new issue