generated from oci/template
rebase to dotnet containter
All checks were successful
Build Docker Image on Commit / build-and-publish (push) Successful in 57s
All checks were successful
Build Docker Image on Commit / build-and-publish (push) Successful in 57s
This commit is contained in:
parent
6531e9422a
commit
7e2e006c62
10 changed files with 33 additions and 109 deletions
3
scripts/00_setup.sh
Normal file → Executable file
3
scripts/00_setup.sh
Normal file → Executable file
|
@ -17,7 +17,7 @@ export DEFAULT_RESONITE_ARGS="-LogsPath /data/resonite/logs \
|
|||
-HeadlessConfig $CONFIG_FILE \
|
||||
$RESONITE_ARGS"
|
||||
|
||||
mkdir -p /data/home /data/resonite /data/steamcmd /etc/crystite/conf.d
|
||||
mkdir -p /data/home /data/resonite /data/steamcmd
|
||||
## Have to do this here, as otherwise stuff doesnt work for some reason
|
||||
# using source so runtime vars can be updated as needed
|
||||
source /scripts/01_install.sh
|
||||
|
@ -35,7 +35,6 @@ if [ "$RUN_AS" != "" ]; then
|
|||
|
||||
export HOME="/home/user"
|
||||
chown $USER_ID:$GROUP_ID /data -R
|
||||
chown $USER_ID:$GROUP_ID /etc/crystite -R
|
||||
|
||||
echo "executing command: $COMMAND"
|
||||
exec sudo -E -u user $COMMAND
|
||||
|
|
16
scripts/01_install.sh
Normal file → Executable file
16
scripts/01_install.sh
Normal file → Executable file
|
@ -8,19 +8,11 @@ if [ "$DISABLE_STEAMCMD" != "true" ]; then
|
|||
fi
|
||||
# if steam beta is empty, or matchs "beta_access_key" we don't need to dwonload the beta
|
||||
if [ -z "$STEAM_BETA" ] || [ "$STEAM_BETA" == "beta_access_key" ]; then
|
||||
echo "Downloading Resonite"
|
||||
/data/steamcmd/steamcmd.sh +login anonymous +force_install_dir /data/resonite +app_update 2519830 +quit
|
||||
echo "[ERROR] Unable to Download Headless, No Beta Key"
|
||||
exit
|
||||
else
|
||||
echo "Downloading Resonite Headless"
|
||||
/data/steamcmd/steamcmd.sh +login ${STEAM_USER} ${STEAM_PASS} ${STEAM_AUTH} +force_install_dir /data/resonite +app_update 2519830 -beta headless -betapassword ${STEAM_BETA} validate +quit
|
||||
/data/steamcmd/steamcmd.sh +force_install_dir /data/resonite +login ${STEAM_USER} ${STEAM_PASS} ${STEAM_AUTH} +app_license_request 2519830 +app_update 2519830 -beta headless -betapassword ${STEAM_BETA} validate +quit
|
||||
fi
|
||||
ln -s /data/resonite/Headless/Resonite.dll /data/resonite/Headless/dotnet-Resonite.dll
|
||||
fi
|
||||
|
||||
# if crystite is enabled, we don't need to check for resonite
|
||||
if [ "$USE_CRYSTITE" != "true" ]; then
|
||||
if [ ! -f "/data/resonite/Headless/Resonite.exe" ]; then
|
||||
echo "Headless/Resonite.exe not found!"
|
||||
echo "Forcing use of Crystite"
|
||||
USE_CRYSTITE="true"
|
||||
fi
|
||||
fi
|
13
scripts/02_setup_config.sh
Normal file → Executable file
13
scripts/02_setup_config.sh
Normal file → Executable file
|
@ -6,29 +6,20 @@ 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
|
||||
cp /mnt/defaults/resonite.json $CONFIG_FILE
|
||||
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
|
||||
cp /mnt/defaults/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
|
4
scripts/03_download_mods.sh
Normal file → Executable file
4
scripts/03_download_mods.sh
Normal file → Executable file
|
@ -53,11 +53,11 @@ done
|
|||
# if resonte mod loader is enabled, create and link rml_mods, libs, and config
|
||||
if [ "$RESONITE_MOD_LOADER" == "true" ]; then
|
||||
for dir in rml_mods rml_libs rml_config; do
|
||||
if [ -d "/data/resonite/$dir" ]; then
|
||||
if [ -d "/data/resonite/Headless/$dir" ]; then
|
||||
continue
|
||||
fi
|
||||
mkdir -p "/data/resonite/Headless/$dir"
|
||||
ln -s "/data/resonite/Headless/$dir" "/data/resonite/$dir"
|
||||
ln -s "./Headless/$dir" "./$dir"
|
||||
done
|
||||
if [ ! -f "/data/resonite/Libraries/ResoniteModLoader.dll" ]; then
|
||||
mkdir -p "/data/resonite/Libraries"
|
||||
|
|
15
scripts/99_start.sh
Normal file → Executable file
15
scripts/99_start.sh
Normal file → Executable file
|
@ -5,14 +5,7 @@ if [ "$STOP_LAUNCH" == "true" ]; then
|
|||
exit 0
|
||||
fi
|
||||
|
||||
# Check if Crystite is enabled
|
||||
if [ "$USE_CRYSTITE" == "true" ]; then
|
||||
echo "Running Crystite"
|
||||
echo "exec: /usr/lib/crystite/crystite"
|
||||
/usr/lib/crystite/crystite
|
||||
else
|
||||
cd /data/resonite/Headless || exit
|
||||
echo "Running Resonite"
|
||||
echo "exec: mono Resonite.exe $DEFAULT_RESONITE_ARGS $RESONITE_ARGS"
|
||||
mono Resonite.exe $DEFAULT_RESONITE_ARGS $RESONITE_ARGS
|
||||
fi
|
||||
cd /data/resonite/Headless || exit
|
||||
echo "Running Resonite"
|
||||
echo "exec: dotnet Resonite.dll $DEFAULT_RESONITE_ARGS $RESONITE_ARGS"
|
||||
dotnet Resonite.dll $DEFAULT_RESONITE_ARGS $RESONITE_ARGS
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue