diff options
author | Mickaël Thomas | 2016-11-10 01:43:09 +0100 |
---|---|---|
committer | Mickaël Thomas | 2016-11-10 02:09:17 +0100 |
commit | e74557bd59b44891f1a32b63b86db660a0a6e88f (patch) | |
tree | 20dc7fedc6032e46613e29c3d03046d1a30ac851 /factorio-headless.install | |
parent | 34c0f5efa96a76e8b5ecaeb7eb9b77c3dc15b9c9 (diff) | |
download | aur-e74557bd59b44891f1a32b63b86db660a0a6e88f.tar.gz |
Update to 0.14.19
Diffstat (limited to 'factorio-headless.install')
-rw-r--r-- | factorio-headless.install | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/factorio-headless.install b/factorio-headless.install index bd82f5012451..7cdadb871c17 100644 --- a/factorio-headless.install +++ b/factorio-headless.install @@ -2,11 +2,22 @@ post_install() { systemd-sysusers factorio.conf [[ -d /var/lib/factorio ]] || install -dm 770 -o factorio -g games /var/lib/factorio + source /etc/conf.d/factorio + # create empty game - [[ -f /var/lib/factorio/.factorio/saves/factorio-service-save.zip ]] || su - factorio -s /bin/sh -c 'factorio --create /var/lib/factorio/.factorio/saves/factorio-service-save.zip 2>&1 >/dev/null' + if [[ ! -f "$SAVE_FILE" ]]; then + echo "Generating initial save file: $SAVE_FILE" + su - factorio -s /bin/sh -c "factorio --create '$SAVE_FILE' 2>&1 >/dev/null" + fi } post_upgrade() { (( $(vercmp $2 '0.12.26-4') < 0 )) && chown -R root:root /usr/share/factorio || true (( $(vercmp $2 '0.12.26-4') < 0 )) && post_install "$1" || true + (( $(vercmp $2 '0.14.12-1') < 0 )) && { + echo "AUTOSAVE_INTERVAL and AUTOSAVE_SLOTS must now be declared in /etc/factorio/server-settings.json" + echo "Please update /etc/factorio/server-settings.json and /etc/conf.d/factorio now." + echo + echo "The systemd service file has been updated, don't forget to run 'systemctl daemon-reload' before restarting factorio." + } || true } |