Code Monkey home page Code Monkey logo

factorioupdatelib's Introduction

Factorio Auto Update Scripts

This set of scripts automates the update process for Factorio and mods on linux using bash scripts. These scripts use the Factorio mod and version API to determine if you are currently running the latest version of Factorio and each mode.

The mod update script tries to take into account dependency checking of the base game, to ensure you don't have issues if a mod has been updated for an experimental version, while you are still using stable for example. This dependency check is non-exhaustive.

Prerequisites

This bash script library requires jq be installed (more info here). You can install it on Ubuntu using the following command.

sudo apt-get update && apt-get install jq

This setup guide will assume your Factorio is/will be installed in /opt/factorio you should change the service and other parameters accordingly if your's will be install elsewhere.

Setup

It is not required to have already installed Factorio to use this script, if you have not installed Factorio yet, the script can be used to auto download and install Factorio for you.

Copy scripts and setup set permissions

Copy the updateFactorio.sh, updateMods.sh, and updateFunctions.sh to the root of your Factorio folder, eg /opt/factorio. Ensure these scripts have execute permissions.

Setup factorio systemd service

This is an example systemd service file you can use to make Factorio auto start and update. You'll want to place this service in /etc/systemd/system/factorio.service.

If you haven't created a service yet and want to just copy/paste the contents into Terminal you can use the following command to create it.

sudo nano /etc/systemd/system/factorio.service

Setting the WorkingDirectory is important for the scripts to be able to work.

...
WorkingDirectory=/opt/factorio
ExecStartPre=/opt/factorio/updateFactorio.sh
ExecStartPre=/opt/factorio/updateMods.sh --server-settings "/opt/factorio/data/saves/YourSaveGame.json" --basePath "/opt/factorio"
ExecStart=/opt/factorio/bin/x64/factorio --start-server "/opt/factorio/data/saves/YourSaveGame.zip" --server-settings "/opt/factorio/data/saves/YourSaveGame.json"
...

Make sure the service is enabled so you can start it later and allow it to auto start on system reboot.

sudo systemctl enable factorio

Other helpful commands

  • Show the output from your factorio service
sudo journalctl -f -u factorio --since "30 minutes ago"
  • Start/Stop the service
sudo systemctl start factorio
sudo systemctl status factorio

factorioupdatelib's People

Contributors

skint007 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.