[Linux] Ini-tweak migration script

Learn about OpenMW mod compatibility, check for problematic mods, discuss issues, and give us feedback about your experience with modded OpenMW.
Post Reply
Posts: 3
Joined: 20 Sep 2017, 17:53

[Linux] Ini-tweak migration script

Post by mupf » 20 Sep 2017, 18:43

I just wrote a little tool for myself. A script to add mod-specific ini-tweaks to the openmw.cfg.
Currently supported mods:

TLM - The Lighting Mod
Monochrome user interface

Is anyone in here interested in an extensive version of this script? If yes: which mods also require ini-tweaks?
Happy testing! :)
(2.53 KiB) Downloaded 30 times

User avatar
Posts: 4
Joined: 21 Oct 2017, 15:39

Re: [Linux] Ini-tweak migration script

Post by Ambrevar » 22 Oct 2017, 13:18

Thanks for this!

Some shell tips:

- Make it a "sh" script as this is POSIX, no need to depend on bash.

- Don't chain "echo"s, use a here-doc:

Code: Select all

Usage $0
- Exit early:

Code: Select all

if [ ! -e openmw.cfg ]
	## Redirect error messages to stderr.
	echo >&2 "openmw.cfg not found."
	## Change the exit code.
	exit 1

## Your un-indented sed command here.
- "sed" runs scripts, it is not limited to a single 's' command.

Code: Select all

sed -i '
' openmw.cfg
This will be much faster as it will fire up one process only.

Note that the inplace option (-i) is not standard, you should use the "ex" command instead.

- Always double-quote variables and use a single "=" for comparison:

Code: Select all

elif  [ "$1" = "-tlm_undo" ]
Hope that helps :)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest