move mapping to userdata

This commit is contained in:
Gustavo 2018-03-31 04:13:45 -03:00
parent 7b5cbd0786
commit 29f4511055

View file

@ -4,12 +4,8 @@
oe_setup_addon script.moonlight oe_setup_addon script.moonlight
# copy gamecontrollerdb.txt to folder if [ ! -f "$ADDON_HOME/gamecontrollerdb.txt" ]; then
MOONLIGHT_CONF_DIR="/storage/.config/moonlight" cp $ADDON_DIR/etc/gamecontrollerdb.txt $ADDON_HOME
if [ ! -f "$MOONLIGHT_CONF_DIR/gamecontrollerdb.txt" ]; then
mkdir -p $MOONLIGHT_CONF_DIR
cp $ADDON_DIR/etc/gamecontrollerdb.txt $MOONLIGHT_CONF_DIR
fi fi
while [ 1 ]; do while [ 1 ]; do
@ -70,6 +66,7 @@ while [ 1 ]; do
fi fi
MOONLIGHT_ARG="$MOONLIGHT_ARG -keydir \"${ADDON_HOME}/keys\"" MOONLIGHT_ARG="$MOONLIGHT_ARG -keydir \"${ADDON_HOME}/keys\""
MOONLIGHT_ARG="$MOONLIGHT_ARG -mapping \"${ADDON_HOME}/gamecontrollerdb.txt\""
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"
@ -79,10 +76,9 @@ while [ 1 ]; do
systemctl stop kodi systemctl stop kodi
fi fi
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 || :
systemctl start kodi systemctl start kodi
fi fi
sleep 1 sleep 1