Adjust handling of docker-mods
Use expansion instead of subshells Use latest tag if tag is not setpull/58/head
rodzic
370cde9b68
commit
ece7564d1f
|
@ -53,21 +53,28 @@ DOCKER_MODS=(${DOCKER_MODS})
|
||||||
for DOCKER_MOD in "${DOCKER_MODS[@]}"; do
|
for DOCKER_MOD in "${DOCKER_MODS[@]}"; do
|
||||||
# Support alternative endpoints
|
# Support alternative endpoints
|
||||||
if [[ ${DOCKER_MOD} == ghcr.io/* ]] || [[ ${DOCKER_MOD} == linuxserver/* ]]; then
|
if [[ ${DOCKER_MOD} == ghcr.io/* ]] || [[ ${DOCKER_MOD} == linuxserver/* ]]; then
|
||||||
DOCKER_MOD=$(echo ${DOCKER_MOD} | sed 's/ghcr.io\///g')
|
DOCKER_MOD="${DOCKER_MOD#ghcr.io/*}"
|
||||||
FILENAME=$(echo ${DOCKER_MOD} | sed 's/[:\/]/./g')
|
ENDPOINT="${DOCKER_MOD%%:*}"
|
||||||
REPO=$(echo ${DOCKER_MOD} | awk -F'(/|:)' '{print $2}')
|
USERNAME="${DOCKER_MOD%%/*}"
|
||||||
ENDPOINT=$(echo ${DOCKER_MOD} | awk -F: '{print $1}')
|
REPO="${ENDPOINT#*/}"
|
||||||
USERNAME=$(echo ${ENDPOINT} | awk -F/ '{print $1}')
|
TAG="${DOCKER_MOD#*:}"
|
||||||
TAG=$(echo ${DOCKER_MOD} | awk -F: '{print $2}')
|
if [[ ${TAG} == "${DOCKER_MOD}" ]]; then
|
||||||
|
TAG="latest"
|
||||||
|
fi
|
||||||
|
FILENAME="${USERNAME}.${REPO}.${TAG}"
|
||||||
AUTH_URL="https://ghcr.io/token?scope=repository%3A${USERNAME}%2F${REPO}%3Apull"
|
AUTH_URL="https://ghcr.io/token?scope=repository%3A${USERNAME}%2F${REPO}%3Apull"
|
||||||
MANIFEST_URL="https://ghcr.io/v2/${ENDPOINT}/manifests/${TAG}"
|
MANIFEST_URL="https://ghcr.io/v2/${ENDPOINT}/manifests/${TAG}"
|
||||||
BLOB_URL="https://ghcr.io/v2/${ENDPOINT}/blobs/"
|
BLOB_URL="https://ghcr.io/v2/${ENDPOINT}/blobs/"
|
||||||
MODE="ghcr"
|
MODE="ghcr"
|
||||||
else
|
else
|
||||||
FILENAME=$(echo ${DOCKER_MOD} | sed 's/[:\/]/./g')
|
ENDPOINT="${DOCKER_MOD%%:*}"
|
||||||
ENDPOINT=$(echo ${DOCKER_MOD} | awk -F: '{print $1}')
|
USERNAME="${DOCKER_MOD%%/*}"
|
||||||
USERNAME=$(echo ${ENDPOINT} | awk -F/ '{print $1}')
|
REPO="${ENDPOINT#*/}"
|
||||||
TAG=$(echo ${DOCKER_MOD} | awk -F: '{print $2}')
|
TAG="${DOCKER_MOD#*:}"
|
||||||
|
if [[ ${TAG} == "${DOCKER_MOD}" ]]; then
|
||||||
|
TAG="latest"
|
||||||
|
fi
|
||||||
|
FILENAME="${USERNAME}.${REPO}.${TAG}"
|
||||||
AUTH_URL="https://auth.docker.io/token?service=registry.docker.io&scope=repository:${ENDPOINT}:pull"
|
AUTH_URL="https://auth.docker.io/token?service=registry.docker.io&scope=repository:${ENDPOINT}:pull"
|
||||||
MANIFEST_URL="https://registry-1.docker.io/v2/${ENDPOINT}/manifests/${TAG}"
|
MANIFEST_URL="https://registry-1.docker.io/v2/${ENDPOINT}/manifests/${TAG}"
|
||||||
BLOB_URL="https://registry-1.docker.io/v2/${ENDPOINT}/blobs/"
|
BLOB_URL="https://registry-1.docker.io/v2/${ENDPOINT}/blobs/"
|
||||||
|
|
Ładowanie…
Reference in New Issue