# Deal with GPG over http proxy
if [ -n "${http_proxy:-}" ]; then
DOWNLOAD_KEYSERVER="hkp://p80.pool.sks-keyservers.net:80"
+ DOWNLOAD_GPG_PROXY="--keyserver-options http-proxy=\"${http_proxy}\""
fi
fi
success=
for _ in $(seq 3); do
- if gpg --keyserver "${DOWNLOAD_KEYSERVER}" \
- --recv-keys "${DOWNLOAD_KEYID}" >/dev/null 2>&1; then
+ if $(gpg --keyserver "${DOWNLOAD_KEYSERVER}" ${DOWNLOAD_GPG_PROXY:-} \
+ --recv-keys "${DOWNLOAD_KEYID}" >/dev/null 2>&1); then
success=1
break
fi
if ! command -V mktemp >/dev/null 2>&1; then
DOWNLOAD_TEMP="${DOWNLOAD_TEMP}/tmp/lxc-download.$$"
-else
+elif [ -n "${DOWNLOAD_TEMP}" ]; then
+ mkdir -p "${DOWNLOAD_TEMP}"
DOWNLOAD_TEMP="$(mktemp -p ${DOWNLOAD_TEMP} -d)"
+else
+ DOWNLOAD_TEMP="${DOWNLOAD_TEMP}$(mktemp -d)"
fi
# Simply list images