2022-07-10 18:49:24 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
# Downloads all docker mod scripts
|
|
|
|
|
2022-07-10 18:57:43 +02:00
|
|
|
MODS=$(curl https://theme-park.dev/themes.json | jq -r '.["docker-mods"]')
|
2022-07-10 18:49:24 +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
|
|
|
|
curl "$value" --create-dirs --output "$DIR/$key" --silent
|
|
|
|
echo "Fetched $key script"
|
|
|
|
done
|
|
|
|
sudo chmod go+rx $DIR
|