16 lines
330 B
Bash
Executable file
16 lines
330 B
Bash
Executable file
#!/bin/bash
|
|
set -e
|
|
|
|
BASE_DIR=/opt/factorio
|
|
|
|
RUN_DIR=${BASE_DIR}/headless/factorio
|
|
|
|
FACTORIO_BIN=${RUN_DIR}/bin/x64/factorio
|
|
WORLDNAME=${BASE_DIR}/saves/world.zip
|
|
|
|
# Create savefile, if none exists
|
|
[ ! -f ${WORLDNAME} ] && ${FACTORIO_BIN} --create ${WORLDNAME}
|
|
|
|
cd ${RUN_DIR}
|
|
|
|
exec ${FACTORIO_BIN} --start-server ${WORLDNAME} "$@"
|