add current players script
This commit is contained in:
parent
9402575a3a
commit
bc6c49107b
1 changed files with 22 additions and 0 deletions
22
mods.sh
Normal file
22
mods.sh
Normal file
|
@ -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
|
Loading…
Reference in a new issue