2016-10-25 18:49:23 +02:00
|
|
|
#!/bin/bash -x
|
2016-02-26 14:59:01 +01:00
|
|
|
|
2016-10-25 18:49:23 +02:00
|
|
|
SAVES=/opt/factorio/saves
|
|
|
|
|
|
|
|
if [ -f $SAVES/*.zip ]
|
2016-02-26 14:59:01 +01:00
|
|
|
then
|
2016-10-25 18:49:23 +02:00
|
|
|
last_save=$(ls $SAVES -lt | grep save |head -1 |awk '{print $(NF)}')
|
2016-02-26 14:59:01 +01:00
|
|
|
else
|
2016-03-26 10:49:27 +01:00
|
|
|
last_save="save.zip"
|
2016-10-25 18:49:23 +02:00
|
|
|
/opt/factorio/bin/x64/factorio --create $SAVES/$last_save
|
2016-02-26 14:59:01 +01:00
|
|
|
fi
|
|
|
|
|
2016-03-26 10:49:27 +01:00
|
|
|
exec /opt/factorio/bin/x64/factorio \
|
2016-03-26 18:04:55 +01:00
|
|
|
--start-server \
|
2016-10-25 18:49:23 +02:00
|
|
|
$SAVES/$last_save
|