diff --git a/docker-mods/vuetorrent/root/etc/cont-init.d/98-themepark b/docker-mods/vuetorrent/root/etc/cont-init.d/98-themepark index ef0ae520..7131ccba 100755 --- a/docker-mods/vuetorrent/root/etc/cont-init.d/98-themepark +++ b/docker-mods/vuetorrent/root/etc/cont-init.d/98-themepark @@ -55,7 +55,7 @@ if [[ -z ${TP_THEME} ]]; then fi RELEASE_FILEPATH='/vuetorrent/release.json' NEEDS_UPDATE=false -CURRENT_RELEASE=$(curl -s https://api.github.com/repos/WDaan/VueTorrent/releases/latest | jq -r ".assets[]") +CURRENT_RELEASE=$(curl -Ls https://api.github.com/repos/WDaan/VueTorrent/releases/latest | jq -r ".assets[]") # =============================================== install_deps() { @@ -146,4 +146,4 @@ if ! grep -q "${TP_DOMAIN}/css/base" "${INDEX_FILEPATH}"; then sed -i "s/<\/body>/<\/body> /g" "${INDEX_FILEPATH}" sed -i "s/<\/body>/<\/body> /g" "${INDEX_FILEPATH}" printf 'Stylesheet set to %s on public index.html\n' "${TP_THEME}" -fi \ No newline at end of file +fi diff --git a/fetch.sh b/fetch.sh index e3f3fd37..6e868277 100644 --- a/fetch.sh +++ b/fetch.sh @@ -1,17 +1,23 @@ #!/usr/bin/env bash -# Downloads all docker mod scripts +# Downloads all docker mod scripts MODS=$(curl https://theme-park.dev/themes.json | jq -r '.["docker-mods"]') if [[ "$0" == "bash" ]]; then DIR="/tmp/theme-park-mods" else - DIR="$0" + 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/98-themepark-$key" --silent + download_file="$DIR/98-themepark-$key" + curl "$value" --create-dirs --output "$download_file" --silent echo "Fetched $key script" + + # Convert line endings from CRLF to LF manually + if [[ "$(tail -c2 "$download_file")" == $'\r\n' ]]; then + perl -pi -e 's/\r\n/\n/' "$download_file" + fi done -chmod -R +x $DIR \ No newline at end of file +chmod -R +x "$DIR" \ No newline at end of file