diff options
author | 2018-07-17 17:33:04 +0000 | |
---|---|---|
committer | 2018-07-17 17:33:04 +0000 | |
commit | 534ba4b901b31b987b0c92e1d012758eadd1a954 (patch) | |
tree | a378aec805226cdb3dadf7b7168c9daf3515828a /boot/imagetest.sh | |
parent | e8cb52b80d4fb40810c455d9948e146e0ec79c19 (diff) | |
parent | 16f7357930c846a1163fc124bd82267be914512f (diff) |
Merge "Improve the way to deploy onap via proxy"
Diffstat (limited to 'boot/imagetest.sh')
-rw-r--r-- | boot/imagetest.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/boot/imagetest.sh b/boot/imagetest.sh new file mode 100644 index 00000000..edd6154e --- /dev/null +++ b/boot/imagetest.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +HTTP_PROXY=$(cat /opt/config/http_proxy.txt) +HTTPS_PROXY=$(cat /opt/config/https_proxy.txt) + +image=$(cat /etc/issue | cut -d' ' -f2 | cut -c1-5) +echo $image +if [ ${image} == '16.04' ] +then + echo "[Service]" > /etc/systemd/system/docker.service.d/http-proxy.conf + echo "Environment=\"http_proxy=http://\"$HTTP_PROXY\"" >> /etc/systemd/system/docker.service.d/http-proxy.conf + echo "Environment=\"https_proxy=https://\"$HTTPS_PROXY\"" >>/etc/systemd/system/docker.service.d/http-proxy.conf + echo "Environment=\"HTTP_PROXY=HTTP://\"$HTTP_PROXY\"" >>/etc/systemd/system/docker.service.d/http-proxy.conf + echo "Environment=\"HTTPS_PROXY=HTTPS://\"$HTTPS_PROXY\"" >>/etc/systemd/system/docker.service.d/http-proxy.conf +elif [ ${image} == '14.04' ] +then + echo " export http_proxy=$HTTP_PROXY " > /etc/default/docker + echo " export https_proxy=$HTTPS_PROXY " >> /etc/default/docker +else echo " It's not a 16 nor a 14 Ubuntu image" +fi |