2017-04-30 21:58:44 +02:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
|
2017-09-05 00:07:33 +02:00
|
|
|
BASE_DIR=/opt/factorio
|
|
|
|
|
|
|
|
RUN_DIR=${BASE_DIR}/headless/factorio
|
|
|
|
|
|
|
|
FACTORIO_BIN=${RUN_DIR}/bin/x64/factorio
|
|
|
|
WORLDNAME=${BASE_DIR}/saves/world.zip
|
2017-04-30 21:58:44 +02:00
|
|
|
|
|
|
|
# Create savefile, if none exists
|
|
|
|
[ ! -f ${WORLDNAME} ] && ${FACTORIO_BIN} --create ${WORLDNAME}
|
|
|
|
|
2017-09-05 00:07:33 +02:00
|
|
|
cd ${RUN_DIR}
|
|
|
|
|
2017-04-30 21:58:44 +02:00
|
|
|
exec ${FACTORIO_BIN} --start-server ${WORLDNAME} "$@"
|