# FactoryMan

A simple Factorio server manager for linux systems.

* Download and install headless factorio server (requires api key)
* Download and install mods directly from mod-list.json
* Start and stop factorio in a screen session, great for remote servers
* Backup saves and server

### Commands

```shell
$> ./factoryman download server
```

Run this command to download factorio-headless_linux_latest.

It will install to path in serverFolder in ``config.yml``

*NOTE: username and apitoken are required in ``config.yml``>factoryman*

---

```shell
$> ./factoryman download mod
```

Run this to download mods directly from ``$serverFolder/mods/mod-list.json``

*NOTE: username and apitoken are required in ``config.yml``>factoryman*

---

```shell
$> ./factoryman start
```

Start factorio server (in screen session by default)

---

```shell
$> ./factoryman stop
```

Stop factorio server (in screen session)

---

```shell
$> ./factoryman backup saves
```

Backup saves to path in ``config.yml``>factoryman>backupDir

---

```shell
$> ./factoryman backup full
```

Backup Full serverDir to backupDir

---

*Note:*

use ``$> screen -LS`` to view server terminal

### Simple Config

```config.yml```

```yaml
server:
  serverFolder: "factorio"
  worldFile: ""
  serverSettings: "factorio/data/server-settings.json"
  serverExec: "factorio/bin/x64/factorio"
  port: 34197
  
factoryman:
  screen: True
  screenName: "Factorio"
  backupDir: "factorio/backups"
  username: ""
  apitoken: ""
```

Default config assumes you have used factoryman to download the server

