diskimage-builder/flavours/local-config/install.d/61-http-proxy
2012-11-10 00:04:13 +13:00

16 lines
403 B
Bash
Executable file

#!/bin/bash
# Save the HTTP if one is available.
# XXX: Obviously not suitable for downloadable images.
set -e
set -o xtrace
if [ -n "$http_proxy" ]; then
sudo -Hiu stack dd of=~stack/.profile oflag=append conv=notrunc << EOF
export no_proxy=192.0.2.1
export http_proxy=$http_proxy
EOF
sudo dd of=/etc/apt/apt.conf.d/61-use-http-proxy << _EOF_
Acquire::http::Proxy "$http_proxy";
_EOF_
fi