Skip to content

Commit

Permalink
Add --console-log support (#461)
Browse files Browse the repository at this point in the history
  • Loading branch information
macbrayne committed Apr 16, 2023
1 parent 4fe8b3d commit f7282c5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ These are the environment variables which can be specified at container run time
| TOKEN | factorio.com token | | 0.17+ |
| UPDATE_MODS_ON_START | If mods should be updated before starting the server | | 0.17+ |
| USERNAME | factorio.com username | | 0.17+ | |
| CONSOLE_LOG_LOCATION | Saves the console log to the specifies location | |

**Note:** All environment variables are compared as strings

Expand Down
5 changes: 5 additions & 0 deletions docker/files/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ LOAD_LATEST_SAVE="${LOAD_LATEST_SAVE:-true}"
GENERATE_NEW_SAVE="${GENERATE_NEW_SAVE:-false}"
SAVE_NAME="${SAVE_NAME:-""}"
BIND="${BIND:-""}"
CONSOLE_LOG_LOCATION="${CONSOLE_LOG_LOCATION:-""}"

mkdir -p "$FACTORIO_VOL"
mkdir -p "$SAVES"
Expand Down Expand Up @@ -89,6 +90,10 @@ FLAGS=(\
--server-id /factorio/config/server-id.json \
)

if [ -n "$CONSOLE_LOG_LOCATION" ]; then
FLAGS+=( --console-log "$CONSOLE_LOG_LOCATION" )
fi

if [ -n "$BIND" ]; then
FLAGS+=( --bind "$BIND" )
fi
Expand Down

0 comments on commit f7282c5

Please sign in to comment.