Add default sunshine config on startup if missing

This commit is contained in:
Josh.5
2022-10-06 22:38:45 +13:00
parent 1fbfd235f1
commit f233991597
3 changed files with 310 additions and 1 deletions

View File

@@ -19,7 +19,15 @@ trap _term SIGTERM SIGINT
# CONFIGURE:
# TODO: Install default configurations
# Install default configurations
mkdir -p /home/${USER}/sunshine
if [[ ! -f /home/${USER}/sunshine/sunshine.conf ]]; then
cp -vf /templates/sunshine/* /home/${USER}/sunshine/
# TODO: Set the default encoder '# encoder = nvenc'
# TODO: Enable the vaapi device if not using nvenc
# vainfo --display drm --device /dev/dri/renderD128 2> /dev/null | grep -E "((VAProfileH264High|VAProfileHEVCMain|VAProfileHEVCMain10).*VAEntrypointEncSlice)"
fi
# Reset the default username/password
if ([ "X${SUNSHINE_USER:-}" != "X" ] && [ "X${SUNSHINE_PASS:-}" != "X" ]); then
sunshine /home/${USER}/sunshine/sunshine.conf --creds ${SUNSHINE_USER:-} ${SUNSHINE_PASS:-}