From 4efa557d48234b4d6b98cdbf7178f9ed632777be Mon Sep 17 00:00:00 2001 From: Ahmad Mahmoudi Date: Fri, 14 Sep 2018 23:01:18 +0000 Subject: [PATCH] Fixed permission issue to run as non-root Fixed the permission denied issue, if this script is run as non-root to set the proxy settings for apt and docker. Change-Id: I9b5913d40ba552c976dc910a106371280e9e8794 --- tools/multi_nodes_gate/setup_gate.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/multi_nodes_gate/setup_gate.sh b/tools/multi_nodes_gate/setup_gate.sh index 0a49f98b..2b4bcaf8 100755 --- a/tools/multi_nodes_gate/setup_gate.sh +++ b/tools/multi_nodes_gate/setup_gate.sh @@ -60,14 +60,14 @@ HTTPS_PROXY=${HTTP_PROXY:-${http_proxy}} if [[ ! -z "${HTTPS_PROXY}" ]] then log_stage_header "Configuring Apt Proxy" - sudo cat << EOF > /etc/apt/apt.conf.d/50proxyconf -Acquire::https::proxy \"${HTTPS_PROXY}\"; -Acquire::http::proxy \"${HTTPS_PROXY}\"; + cat << EOF | sudo tee /etc/apt/apt.conf.d/50proxyconf +Acquire::https::proxy "${HTTPS_PROXY}"; +Acquire::http::proxy "${HTTPS_PROXY}"; EOF log_stage_header "Configuring Docker Proxy" sudo mkdir -p /etc/systemd/system/docker.service.d/ - sudo cat << EOF > /etc/systemd/system/docker.service.d/proxy.conf + cat << EOF | sudo tee /etc/systemd/system/docker.service.d/proxy.conf [Service] Environment="HTTP_PROXY=${HTTP_PROXY}" Environment="HTTPS_PROXY=${HTTPS_PROXY}"