2016-02-26 14:59:01 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
if [ -f /opt/factorio/saves/save.zip ]
|
|
|
|
then
|
|
|
|
echo "###"
|
|
|
|
echo "# Using existing map [save.zip]"
|
|
|
|
echo "###"
|
2016-03-24 09:43:21 +01:00
|
|
|
echo "###"
|
|
|
|
echo "# Finding latest map"
|
|
|
|
echo "###"
|
|
|
|
$last_save=ls /opt/factorio/saves -lt | grep save |head -1 |awk '{print $(NF)}'
|
2016-02-26 14:59:01 +01:00
|
|
|
else
|
|
|
|
echo "###"
|
|
|
|
echo "# Creating a new map [save.zip]"
|
|
|
|
echo "###"
|
2016-02-26 15:03:32 +01:00
|
|
|
/opt/factorio/bin/x64/factorio --create save.zip
|
2016-02-26 14:59:01 +01:00
|
|
|
echo "###"
|
|
|
|
echo "# New map created [save.zip]"
|
|
|
|
echo "###"
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "###"
|
|
|
|
echo "# Launching Game"
|
|
|
|
echo "###"
|
2016-03-24 09:43:21 +01:00
|
|
|
exec /opt/factorio/bin/x64/factorio --disallow-commands --start-server $last_save
|