From 4d905555b4cacf80976e060ae542344e39a170f6 Mon Sep 17 00:00:00 2001 From: Carlo Eugster Date: Mon, 3 Oct 2016 21:56:10 +0200 Subject: [PATCH] Added env for save game file --- .gitignore | 3 +++ Dockerfile | 3 +++ init.sh | 6 +++--- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 8ffbd19..4e52ff8 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,6 @@ Icon Network Trash Folder Temporary Items .apdisk + +# Factorio +saves/* diff --git a/Dockerfile b/Dockerfile index c60ba02..a6e4809 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,10 @@ RUN apt-get update \ RUN useradd -m -d /opt/factorio -s /bin/bash factorio \ && chown -R factorio.factorio /opt/factorio USER factorio + ENV HOME /opt/factorio +ENV SAVEFILE /opt/factorio/saves/factorio_save.zip + WORKDIR /opt/factorio RUN wget -q -O - https://www.factorio.com/download-headless/stable | grep -o -m1 "/get-download/.*/headless/linux64" | awk '{print "--no-check-certificate https://www.factorio.com"$1" -O /tmp/factorio.tar.gz"}' | xargs wget \ diff --git a/init.sh b/init.sh index 20fdd5a..07dd529 100755 --- a/init.sh +++ b/init.sh @@ -1,6 +1,6 @@ #!/bin/bash -if [ ! -f /opt/factorio/saves/save0.zip ]; then - /opt/factorio/bin/x64/factorio --create save0 +if [ ! -f $SAVEFILE ]; then + /opt/factorio/bin/x64/factorio --create $SAVEFILE fi -/opt/factorio/bin/x64/factorio --start-server save0 +/opt/factorio/bin/x64/factorio --start-server $SAVEFILE