Chmod 755 all sh files which can be executed
[functest.git] / docker / config_install_env.sh
1 #!/bin/bash
2
3 set -e
4
5 PIP_PATH=~/.pip
6 PIP_CONF=$PIP_PATH/pip.conf
7 EASY_INSTALL_CONF=~/.pydistutil.cfg
8
9 if [ "x$BASE_PIP_URL" = "x" ];then
10     exit 0
11 fi
12
13 echo "config pip and easy_install"
14 HOSTNAME=`echo $BASE_PIP_URL | awk -F '[:/]' '{print $4}'`
15 if [ "x$HOSTNAME" = "x" ]; then
16     echo "invalid BASE_PIP_URL: $BASE_PIP_URL"
17     exit 1
18 fi
19
20 if [ ! -d $PIP_PATH ];then
21     mkdir $PIP_PATH
22 fi
23
24 echo -e "[global]\ntrusted-host = $HOSTNAME\nindex-url = $BASE_PIP_URL\ntimeout = 6000" > $PIP_CONF
25 echo -e "[easy_install]\nindex-url = $BASE_PIP_URL\nfind-links = $BASE_PIP_URL" > $EASY_INSTALL_CONF
26