Skip to content

Commit

Permalink
running with vars
Browse files Browse the repository at this point in the history
  • Loading branch information
bergsv committed Feb 2, 2024
1 parent bb974fe commit b6fc8ba
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
9 changes: 7 additions & 2 deletions dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,10 @@ RUN c:\steamcmd\steamcmd.exe +login anonymous +app_update 2278520 +quit; exit 0
# Change to Enshrouded Server Directory
WORKDIR "c:\steamcmd\steamapps\common\EnshroudedServer"

######## ENTRYPOINT ########
ENTRYPOINT .\enshrouded_server.exe
COPY enshrouded_server.json .

# Create entrypoint script
COPY entrypoint.ps1 .

# Set the entrypoint
ENTRYPOINT .\entrypoint.ps1
10 changes: 10 additions & 0 deletions enshrouded_server.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "Enshrouded Server",
"password": "",
"saveDirectory": "./savegame",
"logDirectory": "./logs",
"ip": "0.0.0.0",
"gamePort": 15636,
"queryPort": 15637,
"slotCount": 16
}
16 changes: 16 additions & 0 deletions entrypoint.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# entrypoint.ps1

# Read the content of the enshrouded_server.json file
$ConfigPath = "enshrouded_server.json"
$ConfigContent = Get-Content -Raw -Path $ConfigPath | ConvertFrom-Json

# Update the values in the Config File
$ConfigContent.name = $env:name
$ConfigContent.password = $env:password
$ConfigContent.slotCount = $env:slots

# Save the modified Config File
$ConfigContent | ConvertTo-Json | Set-Content -Path $ConfigPath

# Start the Enshrouded Server
.\enshrouded_server.exe

0 comments on commit b6fc8ba

Please sign in to comment.