install and backup script/helper (linux) - alternative to TPFMM

Willkommen in der Transport Fever Community

Welcome to the fan community of Transport Fever and Train Fever, the economic simulators of Urban Games. The community is free for you to share and inform yourself about the game. We cultivate a friendly and objective interaction with each other and our team will be happy to answer any questions you may have.

 

Registration and use is of course free for you.

 

We wish you a lot of fun and hope for active participation.

The Team of the Transport-Fever Community

  • English

    Hi,

    I made (a maybe little quick and a bit dirty) php script, that does following:
    A) It installs mods (must be downloaded manually, e.g. from here to the folder "2install"), to the game's mod-folder

    B) Those installed/extracted archives are being kept in a folder named "installed"

    C) It copies the current mods from the Steam's workshop folder (and keeps them in the game's mod-folder up to date)

    D) It does a back up of every overwritten mod (folder "backup")

    E) It keeps old settings.lua, config/config.lua and mod.lua.bak (I keep copies of slightly adapted modified mod.lua at this mname.)


    I thought maybe someone could also make use of it.

    I made this because there's currently no TPFMM for TPF, yet, and as I use many mods I don't want to do all updating and keeping track of them manually. And also to have backups in case, that mods disappear (already happened with ~3-5 steam mods) and fatally changed ones.

    I also did a script to eliminate duplicate mods, but this is not representable yet (that ones really quick and dirty).


    next step I wanted to solve in a better way is point E) and the possibility to add files/folders to the list.

    as topic states, it's (currently) linux only, php(-cli) needs to be installed. Doing a windows version should be easily possible (is there a "where"-like command?).


    Installation

    English

    1) create a directory where you want to keep the script.

    mkdir ~/tpfmodinstaller

    2) create the needed subdirectories

    cd ~/tpfmodinstaller && mkdir installed installing backup 2install

    3) place the script into the folder (name it e.g. "installmods")

    e.g. use an editor and paste the script below.

    4) make it executable:

    chmod +x installmods

    4) check/modify paths in the first 8 lines of the script

    (path to php executable, path to TPF2, path to steam workshop folder)

    (alternatively you can pass the latter two paths as parameters to the script)


    alternative to 1-3:

    -extraction of the tarball (e.g. into home directory)

    cd ~ && tar -xf modinstaller.tar

    respectively

    cd ~ && tar -xjf modinstaller.tar.bz2



    alternativ zu 1-3:

    -extraktion des tarballs (z.B. im home-Verzeichnis)

    cd ~ && tar -xf modinstaller.tar

    bzw.

    cd ~ && tar -xjf modinstaller.tar.bz2


    Usage/Nutzung:

    English

    -put mods you want to install into the "2install" folder

    -just call the script (from any point, working directory used will always be the path where the script is placed)

    ~/tpfmodinstaller/installmods

    -of course, the user must have rights to read and modify files and folders at those locations

    some output is written to STDOUT, errors to STDERR

    it will return 0 if everything went fine and 1 on error


    example output/Beispielausgabe:

    I called it here with my deduplication script afterwards (if there's demand for it, I can create a publishable version):

    Ich habe hier mit meinem Deduplikations-Skript anschliessend aufgerufen (wenn es hierfür Nachfrage gibt, kann ich eine veröffentlichungsfähige version kreïeren)


    the output is colored / Die Ausgabe ist farbig.



    finally, the script "installmods" / Hier nun das Skript "installmods"

    dependencies / required commands are checked as startup, as well existance of paths.

    Abhängigkeiten / benötigte Kommandos (ausser "where") sowie Exisatenz der Pfade wird am Beginn des Aufrufs geprüft


    If anyone interested, I can also upload a tarball (with directories, files and rights).

    Wenn jemand einen tarball möchte (mit Verzeichnissen, Dateien, Rechte ), kann ich gerne einen erstellen

    Edit:

    board doesn't accept gzipped or bz2ipped files. so I put the uncompressed tarball into a rar archive - rar and zip don't store usage rights, afaik

    externer Link: modinstaller.tar.bz2

    Files

    Dell Precision T7600, 2 x Intel(R) Xeon(R) CPU E5-2665 (8 cores per CPU, 2 threads per core, 20MB L3 cache, 2.4/3.1GHz) (⁼32 logische CPUs), 128 GiB DDR3 ECC registered 1600 MT/s, NVIDIA Corporation GF100GL [Quadro 6000] (6GB GDDR5, 384 bit), SAS Hardware RAID Level 1
    Linux version 4.12.14-lp151.28.36-default ([email protected]) (gcc version 7.4.1 20190905 [gcc-7-branch revision 275407] (SUSE Linux) ) #1 SMP Fri Dec 6 13:50:27 UTC 2019 (8f4a495)

    Edited 2 times, last by tsilaicosneknurd: external download link ().

  • sample output/Beispielausgabe:

    Nachtrag:
    Diese Skripts sollten in keinem Fall in böswilliger Konkurrenz zu TPFMM (und kommender TPF2 Version) sein.
    TPFMM ist eine super Anwendung, in der viel Arbeit drinsteckt - mit entscheidenden Vorteilen (Repositorys, Konfigurationsmöglichkeiten, Modbeschreibungen, Bildern, GUI, u.v.m) und nur mit wenigen Schwachpunkten (Fehlen einer Konsolenvariante - und wenn es nicht in einer proprietären Programmiersprache geschrieben wäre..).

    Dell Precision T7600, 2 x Intel(R) Xeon(R) CPU E5-2665 (8 cores per CPU, 2 threads per core, 20MB L3 cache, 2.4/3.1GHz) (⁼32 logische CPUs), 128 GiB DDR3 ECC registered 1600 MT/s, NVIDIA Corporation GF100GL [Quadro 6000] (6GB GDDR5, 384 bit), SAS Hardware RAID Level 1
    Linux version 4.12.14-lp151.28.36-default ([email protected]) (gcc version 7.4.1 20190905 [gcc-7-branch revision 275407] (SUSE Linux) ) #1 SMP Fri Dec 6 13:50:27 UTC 2019 (8f4a495)

    Edited once, last by tsilaicosneknurd ().