From 12ec73be5388f896ce7ae9876d177d4fb211b327 Mon Sep 17 00:00:00 2001 From: Christophe Vandekerchove Date: Thu, 24 Mar 2016 09:43:21 +0100 Subject: [PATCH] Added feature to take latest save --- README.md | 2 +- smart_launch.sh | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 895c4e1..2fd6186 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/smart_launch.sh b/smart_launch.sh index b501599..2e140b9 100755 --- a/smart_launch.sh +++ b/smart_launch.sh @@ -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