mirror of
https://github.com/factoriotools/factorio-docker.git
synced 2024-11-07 11:17:23 +01:00
29 lines
783 B
Bash
Executable File
29 lines
783 B
Bash
Executable File
#!/bin/bash -x
|
|
|
|
set -e
|
|
|
|
SAVES=/opt/factorio/saves
|
|
|
|
mkdir -p /factorio/saves
|
|
mkdir -p /factorio/mods
|
|
mkdir -p /factorio/config
|
|
|
|
if [ ! -f /factorio/config/server-settings.json ]; then
|
|
cp /opt/factorio/data/server-settings.example.json /factorio/config/server-settings.json
|
|
fi
|
|
|
|
if [ ! -f /factorio/config/map-gen-settings.json ]; then
|
|
cp /opt/factorio/data/map-gen-settings.example.json /factorio/config/map-gen-settings.json
|
|
fi
|
|
|
|
if ! find -L $SAVES -iname \*.zip -mindepth 1 -print | grep -q .; then
|
|
/opt/factorio/bin/x64/factorio \
|
|
--create $SAVES/save.zip \
|
|
--map-gen-settings /opt/factorio/data/map-gen-settings.json
|
|
fi
|
|
|
|
exec /opt/factorio/bin/x64/factorio \
|
|
--port 34197 \
|
|
--start-server-load-latest \
|
|
--server-settings /opt/factorio/data/server-settings.json
|