push headless config
All checks were successful
Build Docker Image on Commit / build-and-publish (push) Successful in 5m30s

This commit is contained in:
merith-tk 2024-11-18 20:30:43 -08:00
parent 2c60c679ac
commit 6531e9422a
10 changed files with 363 additions and 1 deletions

View file

@ -0,0 +1,34 @@
#!/bin/bash
## Setup Resonite Config
echo "Setting up Resonite Config"
# if CONFIG_FILE is not set, use default config path
if [ ! -f $CONFIG_FILE ]; then
echo "No Resonite Config found, copying from template"
cp /mnt/crystite/resonite.json $CONFIG_FILE
# cat /mnt/crystite/resonite.json | jq '.' > $CONFIG_FILE
fi
echo "Generating Crystite configs"
if [ ! -f "/etc/crystite/appsettings.json" ]; then
cat /mnt/crystite/appsettings.json | jq '.' > /etc/crystite/appsettings.json
fi
CONFIG_DATA=$(grep -v " null," "$CONFIG_FILE")
if [ ! -n "$CONFIG_DATA" ]; then
echo "Config file is empty, copying from template"
cp /mnt/crystite/resonite.json $CONFIG_FILE
CONFIG_DATA=$(grep -v " null," "$CONFIG_FILE")
fi
CONFIG_DATA=$(echo "$CONFIG_DATA" | jq ".comment = \"DO NOT EDIT: This file was automatically generated. Please edit $CONFIG_FILE instead.\"")
echo "{ \"Resonite\": $CONFIG_DATA }" > /etc/crystite/conf.d/_generated_resonite.json
## Setup Modloader Configs
if [ "$RESONITE_MOD_LOADER" == "true" ]; then
echo "Setting up Modloader Configs"
echo "{\"Resonite\": {\"pluginAssemblies\": [\"/data/resonite/Headless/Libraries/ResoniteModLoader.dll\"]}}" | jq '.' > /etc/crystite/conf.d/_generated_rml.json
DEFAULT_RESONITE_ARGS=$(echo "$DEFAULT_RESONITE_ARGS -LoadAssembly /data/resonite/Headless/Libraries/ResoniteModLoader.dll")
else
echo "Modloader is disabled"
rm -f /etc/crystite/conf.d/_generated_rml.json
fi