Files

27 lines
1.1 KiB
Bash

#!/bin/sh
# Run through an existing System::Privileged root command channel.
set -eu
[ "$(id -u)" = 0 ] || { echo 'Root required' >&2; exit 1; }
src=${1:-/home/owner/share/tmp/sdk_tools/q70t-remap}
dest=/opt/usr/share/q70t-remap
helper=/opt/usr/apps/FreeMyTVio/res/q70t
[ -d /opt/usr/apps/FreeMyTVio/res ] || { echo 'Install Free My TV first' >&2; exit 1; }
[ -x /usr/bin/node ] && [ -x /usr/bin/dotnet-launcher ]
mkdir -p "$dest" "$helper" /opt/usr/share/tvroot
for f in remap.js worker.sh physical-input.js compat.js; do
cp "$src/$f" "$dest/$f"
chmod 644 "$dest/$f"
done
for f in SamsungTvRemoteInputAgent.dll SamsungTvRemoteInputAgent.runtimeconfig.json; do
cp "$src/helper/$f" "$helper/$f"
chmod 644 "$helper/$f"
done
# Keep a pre-existing boot integration for review instead of replacing it.
if [ -e /opt/usr/share/tvroot/boot ]; then
echo 'Existing tvroot boot file: merge boot.sh manually; runtime copied.'
exit 1
fi
cp "$src/boot.sh" /opt/usr/share/tvroot/boot
chmod 644 /opt/usr/share/tvroot/boot
echo 'Runtime installed. Boot carrier has NOT been written or enabled.'