Skip to content

Commit

Permalink
create-image-from-http.sh: Support HTTP proxy (fix #249)
Browse files Browse the repository at this point in the history
  • Loading branch information
moul committed Dec 22, 2015
1 parent 47d5466 commit 64a3aa7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1152,6 +1152,7 @@ $ scw inspect myserver | jq '.[0].public_ip.address'

### master (unreleased)

* create-image-from-http.sh: Support HTTP proxy ([#249](https://github.com/scaleway/scaleway-cli/issues/249))
* Support of `scw run --userdata=...` ([#202](https://github.com/scaleway/scaleway-cli/issues/202))
* Refactor of `scw _security-groups` ([#197](https://github.com/scaleway/scaleway-cli/issues/197))
* Support of `scw tag --arch=XXX`
Expand Down
11 changes: 10 additions & 1 deletion examples/create-image-from-http.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ IMAGE_BOOTSCRIPT=${IMAGE_BOOTSCRIPT:stable}
VOLUME_SIZE=${VOLUME_SIZE:-50GB}
KEY=$(cat ~/.ssh/id_rsa.pub | awk '{ print $1" "$2 }' | tr ' ' '_')


echo "[+] URL of the tarball: ${URL}"
echo "[+] Target name: ${NAME}"

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


if [ -n "${SCW_GATEWAY_HTTP_PROXY}" ]; then
echo "[+] Configuring HTTP proxy"
# scw exec "${SERVER}" "echo proxy=${SCW_GATEWAY_HTTP_PROY} >> .curlrc"
(
set +x
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
)
fi


echo "[+] Formating and mounting /dev/nbd1..."
scw exec "${SERVER}" 'mkfs.ext4 /dev/nbd1 && mount /dev/nbd1 /mnt'
echo "[+] /dev/nbd1 formatted in ext4 and mounted on /mnt"
Expand Down

0 comments on commit 64a3aa7

Please sign in to comment.