Support FTP servers for file downloads (#850)

This commit is contained in:
Krzysztof Zdulski 2021-04-28 23:44:39 +02:00 committed by GitHub
parent 7164d2b885
commit 3261fbd7e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -25,12 +25,12 @@ if [[ "$MODPACK" ]]; then
downloadUrl=$(curl -Ls -o /dev/null -w %{effective_url} $MODPACK)
if ! [[ $downloadUrl == *.zip ]]; then
log "ERROR Invalid URL given for MODPACK: $downloadUrl resolved from $MODPACK"
log " Must be HTTP or HTTPS and a ZIP file"
log " Must be HTTP, HTTPS or FTP and a ZIP file"
exit 1
fi
fi
log "Downloading mod/plugin pack via HTTP"
log "Downloading mod/plugin pack"
log " from $downloadUrl ..."
if ! curl -sSL -o /tmp/modpack.zip "$downloadUrl"; then
log "ERROR: failed to download from $downloadUrl"

View file

@ -11,7 +11,7 @@ function join_by() {
function isURL() {
local value=$1
if [[ ${value:0:8} == "https://" || ${value:0:7} == "http://" ]]; then
if [[ ${value:0:8} == "https://" || ${value:0:7} == "http://" || ${value:0:6} == "ftp://" ]]; then
return 0
else
return 1