Skip to content

Commit cf92f27

Browse files
committed
Merge pull request #309 from scaleway/moul-patch-3
Fix wget with http_proxy on busybox x86_64
2 parents 776ac5c + 755c38b commit cf92f27

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/create-image-from-http.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ echo "[+] Target name: ${NAME}"
3030

3131

3232
echo "[+] Creating new server in rescue mode with a secondary volume..."
33-
SERVER=$(SCW_TARGET_ARCH="$SCW_TARGET_ARCH" SCW_COMMERCIAL_TYPE="$SCW_COMMERCIAL_TYPE" scw run -d --env="AUTHORIZED_KEY=${KEY} boot=none INITRD_DROPBEAR=1 INITRD_HTTP_PROXY=${SCW_GATEWAY_HTTP_PROXY}" --name="image-writer-${NAME}" "${VOLUME_SIZE}")
33+
SERVER=$(SCW_TARGET_ARCH="$SCW_TARGET_ARCH" SCW_COMMERCIAL_TYPE="$SCW_COMMERCIAL_TYPE" scw run -d --env="AUTHORIZED_KEY=${KEY} boot=none INITRD_DROPBEAR=1" --name="image-writer-${NAME}" "${VOLUME_SIZE}")
3434
echo "[+] Server created: ${SERVER}"
3535

3636

@@ -44,7 +44,7 @@ if [ -n "${SCW_GATEWAY_HTTP_PROXY}" ]; then
4444
# scw exec "${SERVER}" "echo proxy=${SCW_GATEWAY_HTTP_PROY} >> .curlrc"
4545
(
4646
set +x
47-
scw exec "${SERVER}" "echo http_proxy = ${SCW_GATEWAY_HTTP_PROXY} >> .wgetrc" >/dev/null 2>/dev/null || (echo "Failed to configure HTTP proxy"; exit 1) || exit 1
47+
scw exec "${SERVER}" "echo export http_proxy=${SCW_GATEWAY_HTTP_PROXY} > /proxy-env" >/dev/null 2>/dev/null || (echo "Failed to configure HTTP proxy"; exit 1) || exit 1
4848
)
4949
fi
5050

@@ -56,7 +56,7 @@ echo "[+] /dev/nbd1 formatted in ext4 and mounted on /mnt"
5656

5757

5858
echo "[+] Download tarball and write it to /mnt"
59-
scw exec "${SERVER}" "wget -qO - ${URL} | tar -C /mnt/ -xf - && sync"
59+
scw exec "${SERVER}" "touch /proxy-env; . /proxy-env; wget -qO - ${URL} | tar -C /mnt/ -xf - && sync"
6060
echo "[+] Tarball extracted on disk"
6161

6262

0 commit comments

Comments
 (0)