simplify startup

This commit is contained in:
David Andersen 2016-10-25 18:30:24 +00:00
parent 3a007b377f
commit f3df464856

View File

@ -2,14 +2,9 @@
SAVES=/opt/factorio/saves SAVES=/opt/factorio/saves
if [ -f $SAVES/*.zip ] if [ ! -f $SAVES/*.zip ]
then then
last_save=$(ls $SAVES -lt | grep save |head -1 |awk '{print $(NF)}') /opt/factorio/bin/x64/factorio --create $SAVES/save.zip
else
last_save="save.zip"
/opt/factorio/bin/x64/factorio --create $SAVES/$last_save
fi fi
exec /opt/factorio/bin/x64/factorio \ exec /opt/factorio/bin/x64/factorio --start-server-load-latest
--start-server \
$SAVES/$last_save