Skip to content

Commit 90a7918

Browse files
committed
Merge pull request #250 from moul/support-http-proxy
create-image-from-http.sh: Support HTTP proxy (fix #249)
2 parents 47d5466 + 64a3aa7 commit 90a7918

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,6 +1152,7 @@ $ scw inspect myserver | jq '.[0].public_ip.address'
11521152

11531153
### master (unreleased)
11541154

1155+
* create-image-from-http.sh: Support HTTP proxy ([#249](https://github.com/scaleway/scaleway-cli/issues/249))
11551156
* Support of `scw run --userdata=...` ([#202](https://github.com/scaleway/scaleway-cli/issues/202))
11561157
* Refactor of `scw _security-groups` ([#197](https://github.com/scaleway/scaleway-cli/issues/197))
11571158
* Support of `scw tag --arch=XXX`

examples/create-image-from-http.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ IMAGE_BOOTSCRIPT=${IMAGE_BOOTSCRIPT:stable}
2020
VOLUME_SIZE=${VOLUME_SIZE:-50GB}
2121
KEY=$(cat ~/.ssh/id_rsa.pub | awk '{ print $1" "$2 }' | tr ' ' '_')
2222

23-
2423
echo "[+] URL of the tarball: ${URL}"
2524
echo "[+] Target name: ${NAME}"
2625

@@ -35,6 +34,16 @@ scw exec -w "${SERVER}" 'uname -a'
3534
echo "[+] Server is booted"
3635

3736

37+
if [ -n "${SCW_GATEWAY_HTTP_PROXY}" ]; then
38+
echo "[+] Configuring HTTP proxy"
39+
# scw exec "${SERVER}" "echo proxy=${SCW_GATEWAY_HTTP_PROY} >> .curlrc"
40+
(
41+
set +x
42+
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
43+
)
44+
fi
45+
46+
3847
echo "[+] Formating and mounting /dev/nbd1..."
3948
scw exec "${SERVER}" 'mkfs.ext4 /dev/nbd1 && mount /dev/nbd1 /mnt'
4049
echo "[+] /dev/nbd1 formatted in ext4 and mounted on /mnt"

0 commit comments

Comments
 (0)