Skip to content

Commit da551f2

Browse files
committed
Set env variables when using proxy
1 parent 45f8dc1 commit da551f2

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

create-arch-bootstrap.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ generate_mirrorlist () {
113113
unset proxy
114114
if [ -n "${DOWNLOAD_PROXY}" ]; then
115115
proxy=(-x "${DOWNLOAD_PROXY}")
116+
117+
export http_proxy="${DOWNLOAD_PROXY}"
118+
export https_proxy="${DOWNLOAD_PROXY}"
119+
export HTTP_PROXY="${DOWNLOAD_PROXY}"
120+
export HTTPS_PROXY="${DOWNLOAD_PROXY}"
116121
fi
117122

118123
cd "${script_dir}" || exit 1
@@ -167,9 +172,9 @@ if [ -f mirrorlist ]; then
167172
mv mirrorlist "${bootstrap}"/etc/pacman.d/mirrorlist
168173
fi
169174

170-
if [ -n "${DOWNLOAD_PROXY}" ]; then
171-
sed -i "s,#XferCommand = /usr/bin/curl -L -C - -f -o %o %u,XferCommand = /usr/bin/curl ${proxy[0]} ${proxy[1]} -L -C - -f -o %o %u," "${bootstrap}"/etc/pacman.conf
172-
fi
175+
#if [ -n "${DOWNLOAD_PROXY}" ]; then
176+
# sed -i "s,#XferCommand = /usr/bin/curl -L -C - -f -o %o %u,XferCommand = /usr/bin/curl ${proxy[0]} ${proxy[1]} -L -C - -f -o %o %u," "${bootstrap}"/etc/pacman.conf
177+
#fi
173178

174179
sed -i 's/#DisableSandboxSyscalls/#DisableSandboxSyscalls\nDisableSandbox/' "${bootstrap}"/etc/pacman.conf
175180

create-conty.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ fi
2929
unset proxy
3030
if [ -n "${DOWNLOAD_PROXY}" ]; then
3131
proxy=(-x "${DOWNLOAD_PROXY}")
32+
33+
export http_proxy="${DOWNLOAD_PROXY}"
34+
export https_proxy="${DOWNLOAD_PROXY}"
35+
export HTTP_PROXY="${DOWNLOAD_PROXY}"
36+
export HTTPS_PROXY="${DOWNLOAD_PROXY}"
3237
fi
3338

3439
cd "${script_dir}" || exit 1

0 commit comments

Comments
 (0)