aboutsummaryrefslogtreecommitdiffstats
path: root/boot/imagetest.sh
diff options
context:
space:
mode:
authorAbirATTAR <abir.el_attar@nokia.com>2018-07-03 09:28:58 +0200
committerAbirATTAR <abir.el_attar@nokia.com>2018-07-16 17:47:39 +0200
commit16f7357930c846a1163fc124bd82267be914512f (patch)
tree465257abbb766abafc244ef0077429fb8b9f66db /boot/imagetest.sh
parentfd761391ba59ba11452270807033e3605da5c6a4 (diff)
Improve the way to deploy onap via proxy
Issue-ID: OOM-1275 Change-Id: I0d77bcfe1e9ca183b3ba1aa56fff713db33b677b Signed-off-by: Abir EL ATTAR <abir.el_attar@nokia.com>
Diffstat (limited to 'boot/imagetest.sh')
-rw-r--r--boot/imagetest.sh20
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