nightly update script for linux

OpenTTD is a fully open-sourced reimplementation of TTD, written in C++, boasting improved gameplay and many new features.

Moderator: OpenTTD Developers

Post Reply
alyr
Engineer
Engineer
Posts: 26
Joined: 01 Apr 2008 07:59
Location: Budapest, Hungary

nightly update script for linux

Post by alyr »

Hi!
I've made a little script for linux users who want to download the latest nightly versions but are lazy to do it manually. I'm not an expert or anything, so the script is not perfect in any way, i just wanted to make my life easier, and i thought 'why not share it?'. :)

What it does:
- checks the latest nightly version on the server
- downloads & extracts the latest nightly (in other words it updates OpenTTD) if needed
- stores the version number so later, when you run the script it can check if an update is required

Instructions:
- download openttd_update.txt
- open it with a text editor
- change the line 'directory="$HOME/openttd"' and 'architecture="amd64"' to match your settings and save the file as 'openttd_update' (without extension)
- make the file executable

Code: Select all

chmod +x openttd_update
- move the file to /usr/local/bin

Code: Select all

sudo mv openttd_update /usr/local/bin/
- if you want to update OpenTTD to the latest nightly, just use the "openttd_update" command

You need to have wget, and tar installed for the script to work.

Of course you can do whatever you want with the script, modify as your needs require. Have fun! :)


Changes:
v3:
- fixed the unpacking to work with tar.xz
- added version info to output


v2:
- curl not needed anymore
- added the option to set system architecture (thx Rubidium)
- the default openttd directory is '$HOME/openttd' (thx Alberth)

Attachments
openttd_update.txt
The script (v3)
(3.12 KiB) Downloaded 504 times
Expected results on first & second run
Expected results on first & second run
openttd_update_v3_800.png (120.48 KiB) Viewed 4880 times
Last edited by alyr on 29 Apr 2012 11:41, edited 5 times in total.
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: nightly update script for linux

Post by Rubidium »

I reckon you need to make the architecture configurable; not everyone has x86_64. You can furthermore remove the requirement on either curl or wget; they're both the same except for their initial behaviour. One dumping to the console by default, the other dumping to file. But they can both do "the other" thing as well.

Good you used finger.openttd.org though!
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: nightly update script for linux

Post by planetmaker »

Have a look at http://wiki.openttd.org/OpenTTD_Updaters and in particular autostart. It will shortly be available again in a public repo, meanwhile here attached as a tar with config templates for the coop servers as well as the current nightly.
Attachments
autostart.tar
autostart and update for OS with bash. Updates to openttdcoop servers or nightly, depending upon config file used. License: GPL v2, author: Ammler
(31.5 KiB) Downloaded 214 times
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4766
Joined: 09 Sep 2007 05:03
Location: home

Re: nightly update script for linux

Post by Alberth »

/home/yourname is normally also known as $HOME, except $HOME points to the right home directory for every user.
alyr
Engineer
Engineer
Posts: 26
Joined: 01 Apr 2008 07:59
Location: Budapest, Hungary

Re: nightly update script for linux

Post by alyr »

Rubidium wrote:I reckon you need to make the architecture configurable; not everyone has x86_64. You can furthermore remove the requirement on either curl or wget; they're both the same except for their initial behaviour. One dumping to the console by default, the other dumping to file. But they can both do "the other" thing as well.

Good you used finger.openttd.org though!
Thank you for the advice ( :bow: ), i've modified the script (added architecture, removed curl).
planetmaker wrote:Have a look at http://wiki.openttd.org/OpenTTD_Updaters and in particular autostart. It will shortly be available again in a public repo, meanwhile here attached as a tar with config templates for the coop servers as well as the current nightly.
I've seen this script mentioned on the forums (i really do use search), but it was complex enough for me and contained too much servers/revision types so that i decided to make a small script for myself just to try scripting. I really don't want to compete with anyone else, just trying to be constructive. :oops:
Alberth wrote:/home/yourname is normally also known as $HOME, except $HOME points to the right home directory for every user.
Thanks! :wink:
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: nightly update script for linux

Post by Zuu »

It would be nice if you add a section for your script at the wiki: http://wiki.openttd.org/OpenTTD_Updaters . Put some info there with a link to this thread for specific download/usage info.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: nightly update script for linux

Post by planetmaker »

It's linked on that page. It just links to the svn which is (currently) unavailable for some reason I didn't yet establish.
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: nightly update script for linux

Post by Zuu »

planetmaker wrote:It's linked on that page. It just links to the svn which is (currently) unavailable for some reason I didn't yet establish.
I was not refering to autostart, but the script that the thread starter (alyr) has created.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
alyr
Engineer
Engineer
Posts: 26
Joined: 01 Apr 2008 07:59
Location: Budapest, Hungary

Re: nightly update script for linux

Post by alyr »

Zuu wrote:It would be nice if you add a section for your script at the wiki: http://wiki.openttd.org/OpenTTD_Updaters . Put some info there with a link to this thread for specific download/usage info.
I've added a section to the wiki as you advised.
alyr
Engineer
Engineer
Posts: 26
Joined: 01 Apr 2008 07:59
Location: Budapest, Hungary

Re: nightly update script for linux

Post by alyr »

I've updated the script to work with the tar.xz files that openTTD has been using for a while now.
Post Reply

Return to “General OpenTTD”

Who is online

Users browsing this forum: No registered users and 5 guests