Skip to content

Instantly share code, notes, and snippets.

@t0mtee
t0mtee / enable.sh
Last active December 9, 2023 20:28
Lenny's Mod Loader Linux Script. Put it in your lml folder. (written by ChatGPT)
#!/bin/bash
# Erase lines between <Mods> and </Mods> excluding the tags
sed -i '/<Mods>/,/<\/Mods>/ { /<Mods>/b; /<\/Mods>/b; d; }' mods.xml
# Erase lines between <LoadOrder> and </LoadOrder> excluding the tags
sed -i '/<LoadOrder>/,/<\/LoadOrder>/ { /<LoadOrder>/b; /<\/LoadOrder>/b; d; }' mods.xml
# Find all install.xml files in subfolders, sort them alphabetically based on parent directory's name, and process each one
find . -name 'install.xml' | sort -t/ -k2,2 -r | while read -r install_xml; do