All installed Mods for minetest.sp-codes.de
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
617 B

#!/bin/bash
echo "updating mod list"
wget -O mods.txt https://git.sp-codes.de/minetest/minetest-mods/raw/branch/master/mods.txt
BASE=mods
while IFS="" read -r line || [ -n "$line" ]
do
IFS=' ' read -ra mod <<< "$line"
echo "downloading ${mod[0]}"
sleep 1
wget -q "${mod[1]}" -O temp.zip
echo "extracting ${mod[0]}"
unzip -oq temp.zip -d temp
rm -rf "$BASE/${mod[0]}/"
mkdir -p "$BASE/${mod[0]}/"
if [[ $(find temp/* -maxdepth 0 | wc -l) == 1 ]]; then
cp -r temp/*/* "$BASE/${mod[0]}"
else
cp -r temp/* "$BASE/${mod[0]}"
fi
echo "cleanup"
rm -rf temp
rm temp.zip
done < mods.txt