Added feature to take latest save

This commit is contained in:
Christophe Vandekerchove 2016-03-24 09:43:21 +01:00
parent 2d9d8e17b8
commit 2bd0d475eb
2 changed files with 6 additions and 2 deletions

View File

@ -9,7 +9,7 @@ Current Version
#### Factorio
[factorio's site](http://www.factorio.com)
#### Docker image
Automatically takes latest save or autosave. when restarting the container.
Versions
-----
I'm keeping the image up to date. If you need to use an older version, checkout out the different tags.

View File

@ -5,6 +5,10 @@ then
echo "###"
echo "# Using existing map [save.zip]"
echo "###"
echo "###"
echo "# Finding latest map"
echo "###"
$last_save=ls /opt/factorio/saves -lt | grep save |head -1 |awk '{print $(NF)}'
else
echo "###"
echo "# Creating a new map [save.zip]"
@ -18,4 +22,4 @@ fi
echo "###"
echo "# Launching Game"
echo "###"
exec /opt/factorio/bin/x64/factorio --disallow-commands --start-server save.zip
exec /opt/factorio/bin/x64/factorio --disallow-commands --start-server $last_save