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
[factorio's site](http://www.factorio.com) [factorio's site](http://www.factorio.com)
#### Docker image #### Docker image
Automatically takes latest save or autosave. when restarting the container.
Versions Versions
----- -----
I'm keeping the image up to date. If you need to use an older version, checkout out the different tags. 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 "###"
echo "# Using existing map [save.zip]" echo "# Using existing map [save.zip]"
echo "###" echo "###"
echo "###"
echo "# Finding latest map"
echo "###"
$last_save=ls /opt/factorio/saves -lt | grep save |head -1 |awk '{print $(NF)}'
else else
echo "###" echo "###"
echo "# Creating a new map [save.zip]" echo "# Creating a new map [save.zip]"
@ -18,4 +22,4 @@ fi
echo "###" echo "###"
echo "# Launching Game" echo "# Launching Game"
echo "###" 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