diff --git a/mods.sh b/mods.sh new file mode 100644 index 0000000..f350728 --- /dev/null +++ b/mods.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env sh + +world=/opt/luanti/worlds/paultopia +moddir=/opt/luanti/mods + + +while true +do + mods=$(grep -o -E "load_mod_[a-zA-Z0-9\_\-]+ ?= ?true" $world/world.mt | grep -o -E "load_mod_[a-zA-Z0-9\_\-]+") + my_mods="[" + c="" + for mod in $mods; do + name=$(echo $mod | sed -e 's/load_mod_//g') + my_mods="$my_mods$c{\"name\":\"$name\"}" + if [ "$c" = "" ]; then + c="," + fi + done + my_mods="$my_mods]" + echo $my_mods | jq > mods.json + sleep 600 +done