From 3261fbd7e9dabd4e0379b6103492b201a7a10d77 Mon Sep 17 00:00:00 2001 From: Krzysztof Zdulski Date: Wed, 28 Apr 2021 23:44:39 +0200 Subject: [PATCH] Support FTP servers for file downloads (#850) --- start-finalSetupModpack | 4 ++-- start-utils | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/start-finalSetupModpack b/start-finalSetupModpack index 4c0bcf8c..869d8c22 100644 --- a/start-finalSetupModpack +++ b/start-finalSetupModpack @@ -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" diff --git a/start-utils b/start-utils index b85c7044..2c8909c1 100644 --- a/start-utils +++ b/start-utils @@ -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