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
if [ -f $SAVES/*.zip ]
if [ ! -f $SAVES/*.zip ]
then
last_save=$(ls $SAVES -lt | grep save |head -1 |awk '{print $(NF)}')
else
last_save="save.zip"
/opt/factorio/bin/x64/factorio --create $SAVES/$last_save
/opt/factorio/bin/x64/factorio --create $SAVES/save.zip
fi
exec /opt/factorio/bin/x64/factorio \
--start-server \
$SAVES/$last_save
exec /opt/factorio/bin/x64/factorio --start-server-load-latest