diff --git a/start-finalSetup02Modpack b/start-finalSetup02Modpack index 782377c0..94b637a0 100644 --- a/start-finalSetup02Modpack +++ b/start-finalSetup02Modpack @@ -78,10 +78,20 @@ done fi if [[ "$MANIFEST" ]]; then -EFFECTIVE_MANIFEST_URL=$(curl -Ls -o /dev/null -w %{url_effective} $MANIFEST) -case "X$EFFECTIVE_MANIFEST_URL" in + if [[ -e "$MANIFEST" ]]; then + EFFECTIVE_MANIFEST_FILE=$MANIFEST + elif isURL "$MANIFEST"; then + EFFECTIVE_MANIFEST_FILE=/tmp/manifest.json + EFFECTIVE_MANIFEST_URL=$(curl -Ls -o /dev/null -w %{url_effective} $MANIFEST) + curl -Ls -o $EFFECTIVE_MANIFEST_FILE "$EFFECTIVE_MANIFEST_URL" + else + echo "MANIFEST='$MANIFEST' is not a valid manifest url or location" + exit 2 + fi + +case "X$EFFECTIVE_MANIFEST_FILE" in X*.json) - if [ -f "${EFFECTIVE_MANIFEST_URL}" ]; then + if [ -f "${EFFECTIVE_MANIFEST_FILE}" ]; then MOD_DIR=${FTB_BASE_DIR:-/data}/mods if [ ! -d "$MOD_DIR" ] then @@ -89,7 +99,7 @@ case "X$EFFECTIVE_MANIFEST_URL" in mkdir -p "$MOD_DIR" fi echo "Starting manifest download..." - cat "${EFFECTIVE_MANIFEST_URL}" | jq -r '.files[] | (.projectID|tostring) + " " + (.fileID|tostring)'| while read -r p f + cat "${EFFECTIVE_MANIFEST_FILE}" | jq -r '.files[] | (.projectID|tostring) + " " + (.fileID|tostring)'| while read -r p f do if [ ! -f $MOD_DIR/${p}_${f}.jar ] then diff --git a/start-utils b/start-utils index 8a2cd621..a2aaa18d 100644 --- a/start-utils +++ b/start-utils @@ -3,7 +3,7 @@ function isURL { local value=$1 - if [[ ${value:0:8} == "https://" || ${value:0:7} = "http://" ]]; then + if [[ ${value:0:8} == "https://" || ${value:0:7} == "http://" ]]; then return 0 else return 1 @@ -39,4 +39,4 @@ function debug { if isDebugging; then echo "DEBUG: $*" fi -} \ No newline at end of file +}