Initialize path config

This commit is contained in:
Knut Ahlers 2016-12-15 04:55:16 +01:00
parent 3722dba10c
commit 14611dc2a4
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E
3 changed files with 10 additions and 2 deletions

View file

@ -14,8 +14,7 @@ RUN set -ex \
&& useradd -d /opt/factorio -M -u 10000 factorio \ && useradd -d /opt/factorio -M -u 10000 factorio \
&& tar -C /opt -x -z -f /tmp/factorio.tgz \ && tar -C /opt -x -z -f /tmp/factorio.tgz \
&& chown -R factorio:factorio /opt/factorio \ && chown -R factorio:factorio /opt/factorio \
&& rm /tmp/factorio.tgz \ && rm /tmp/factorio.tgz
&& sed -i "s;^write-data=.*$;write-data=/data;" /opt/factorio/config/config.ini
USER factorio USER factorio

4
config.ini Normal file
View file

@ -0,0 +1,4 @@
[path]
read-data=__PATH__executable__/../../data
write-data=/data

View file

@ -6,6 +6,11 @@ ACTION=$1
BINARY="/opt/factorio/bin/x64/factorio" BINARY="/opt/factorio/bin/x64/factorio"
MAP_FILE="mapfile.zip" MAP_FILE="mapfile.zip"
if ! [ -e /opt/factorio/config/config.ini ]; then
mkdir -p /opt/factorio/config
cp /opt/defaults/config.ini /opt/factorio/config/config.ini
fi
case ${ACTION} in case ${ACTION} in
"init") "init")
echo "Initializing files in case they do not exist: map-gen-settings.json / server-settings.json" echo "Initializing files in case they do not exist: map-gen-settings.json / server-settings.json"