1 changed files with 23 additions and 0 deletions
@ -0,0 +1,23 @@
|
||||
#!/bin/bash |
||||
|
||||
echo "updating mod list" |
||||
curl https://git.sp-codes.de/minetest/minetest-mods/raw/branch/master/mods.txt > mods.txt |
||||
|
||||
BASE=mods |
||||
|
||||
while IFS="" read -r line || [ -n "$line" ] |
||||
do |
||||
IFS=' ' read -ra mod <<< "$line" |
||||
echo "downloading ${mod[0]}" |
||||
wget -q "${mod[1]}" -O temp.zip |
||||
echo "extracting ${mod[0]}" |
||||
unzip -oq temp.zip -d "$BASE/${mod[0]}" |
||||
FIRST=$(zipinfo -1 temp.zip | head -n 1) |
||||
if [[ "$FIRST" == */ ]] |
||||
then |
||||
cp -r "$BASE/${mod[0]}/$FIRST"* "$BASE/${mod[0]}/" |
||||
rm -r "$BASE/${mod[0]}/$FIRST" |
||||
fi |
||||
echo "cleanup" |
||||
rm temp.zip |
||||
done < mods.txt |
Loading…
Reference in new issue