2022-07-10 18:39:49 +02:00
|
|
|
#!/usr/bin/env bash
|
2022-07-10 18:49:03 +02:00
|
|
|
# Downloads all docker mod scripts
|
2022-07-10 18:39:49 +02:00
|
|
|
|
2022-07-10 18:56:58 +02:00
|
|
|
MODS=$(curl https://theme-park.dev/themes.json | jq -r '.["docker-mods"]')
|
2022-07-10 18:39:49 +02:00
|
|
|
if [[ "$0" == "bash" ]]; then
|
|
|
|
DIR="/tmp/theme-park-mods"
|
|
|
|
else
|
|
|
|
DIR="$0"
|
|
|
|
fi
|
|
|
|
mkdir -p "$DIR"
|
|
|
|
printf "\nSaving mods into $DIR\n\n"
|
|
|
|
jq -r 'to_entries | map(.key + "|" + (.value | tostring)) | .[]' <<< "$MODS" | \
|
|
|
|
while IFS='|' read key value; do
|
2022-07-22 14:10:57 +02:00
|
|
|
curl "$value" --create-dirs --output "$DIR/98-themepark-$key" --silent
|
2022-07-10 18:39:49 +02:00
|
|
|
echo "Fetched $key script"
|
|
|
|
done
|
2022-07-22 19:36:03 +02:00
|
|
|
chmod -R +x $DIR
|