Hello,
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!
[Linux] Ini-tweak migration script
[Linux] Ini-tweak migration script
- Attachments
-
- openmw-initweakconv.tgz
- (2.53 KiB) Downloaded 170 times
Re: [Linux] Ini-tweak migration script
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:
- Exit early:
- "sed" runs scripts, it is not limited to a single 's' command.
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:
Hope that helps
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
cat<<EOF
Usage $0
...
EOF
Code: Select all
if [ ! -e openmw.cfg ]
then
## Redirect error messages to stderr.
echo >&2 "openmw.cfg not found."
## Change the exit code.
exit 1
fi
## Your un-indented sed command here.
Code: Select all
sed -i '
s/foo/bar/
s/qux/quux/
' openmw.cfg
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" ]