Fix install and upgrade scripts

This commit is contained in:
2021-03-05 07:38:51 +01:00
parent d5c6a01a0d
commit 1b3318ec2f
3 changed files with 16 additions and 11 deletions

View File

@@ -115,8 +115,16 @@ regen_worldmt() {
ls $mods_path | while read -r mod; do
if [[ -d $mods_path/$mod ]]; then
ln -s $mods_path/$mod $mods_minetest/$mod
if [[ -e $mods_path/$mod/modpack.txt || -e $mods_path/$mod/modpack.conf ]]; then
if [[ -e $mods_path/$mod/init.lua ]]; then
local mod_enable="true"
for (( modn=1; modn<=$i; modn++ )); do
if [[ ${md[$modn]} == $mod ]]; then
mod_enable="false"
fi
done
echo "load_mod_$mod = $mod_enable" >> /tmp/world.mt
else
ls $mods_path/$mod | while read -r submod; do
if [[ -d $mods_path/$mod/$submod ]]; then
local mod_enable="true"
@@ -128,14 +136,6 @@ regen_worldmt() {
echo "load_mod_$submod = $mod_enable" >> /tmp/world.mt
fi
done
else
local mod_enable="true"
for (( modn=1; modn<=$i; modn++ )); do
if [[ ${md[$modn]} == $mod ]]; then
mod_enable="false"
fi
done
echo "load_mod_$mod = $mod_enable" >> /tmp/world.mt
fi
fi
done