Clone wiki

openttd-init / Home

Important!!

Before you download this script, consider using our Docker Container to automatically get all the same features, but also getting a much more stable server. And also the possibility to run multiple servers on the same computer, without any conflict or strange configurations.

See https://registry.hub.docker.com/u/bateau/openttd/ for more information

If you still want to do things manually, please keep on reading :)

Who needs this script?

If you run a dedicated openttd server on a Ubuntu or Debian OS, this script will make it easier for you to start and stop and restart your server.

Requirements

  • OPENTTD already installed and tested.
  • Ubuntu or Debian OS
  • screen package installed sudo apt-get install screen

How to install it on my server?

1. Navigate to the 'Downloads' menu on top of this wiki. Download the latest release and unzip it to the home folder

2. Symlink the openttd file to `/etc/init.d/openttd`, set the required premissions and update rc.d.

sudo ln -s ~/openttd-init/openttd /etc/init.d/openttd
chmod 755  ~/openttd-init/openttd
sudo update-rc.d openttd defaults

3. Edit the variables in `config.example` and rename it to `config`.

4. By typing: service openttd help you will get a list of the commands you can use.

5. To setup a cron job for automatically save the game: Type: crontab -e

At the bottom of the file add this:

# Save the OPENTTD game
00 04 * * * /etc/init.d/openttd autosave

This will save the game once every day at 04:00am.

To custimize the cron job for your needs, see https://help.ubuntu.com/community/CronHowto

Request a feature or found a bug

If you have a good idea of a feature or you have found a bug in my script. Please create a issue by click on the "issues" button on the menu above.

Finding this script usefully?

Please consider to btn_donate_LG.gif via paypal or tip me on Gratipay. Any contribution will be greatly appreciated.

Changelog

Version 1.1.1

Bugfix for load and save when using cron job

Version 1.1

Implemented the following commands:

  • Load
  • Save
  • Autosave (for Cron jobs)

Version 1.0

Implemented the following commands:

  • start
  • stop
  • restart
  • help (list all available commands)

Updated