Removed opendaylight build capabilities as a preparation toward Arno SR1
[genesis.git] / fuel / build / f_odl_docker / scripts / prep_nets_for_odl.sh
1 #!/bin/bash
2 # a "cheat" way to install docker on the controller
3 # can only be used if you have a connecting out to the internet
4
5 # Usage: ./install_docker.sh <ip of default route to remove> <ip of default gw to add>
6
7 OLDGW=$1
8 #!/bin/bash
9 # a "cheat" way to install docker on the controller
10 # can only be used if you have a connecting out to the internet
11
12 # Usage: ./install_docker.sh <ip of default route to remove> <ip of default gw to add>
13
14 OLDGW=$1
15 NEWGW=$2
16 IMAGEPATH=/opt/opnfv
17 IMAGENAME=odl_docker_image.tar
18 SOURCES=/etc/apt/sources.list
19
20
21 if [ "$#" -ne 2]; then
22         echo "Two args not provided, will not touch networking"
23 else
24
25         # Fix routes
26         echo "Fixing routes"
27         #DEBUG
28         netstat -rn
29
30         echo "delete old def route"
31         route delete default gw $1
32         echo "adding new def route"
33         route add default gw $2
34
35         echo " you should see a good nslookup now"
36         nslookup www.google.ca
37 #!/bin/bash
38 # a "cheat" way to install docker on the controller
39 # can only be used if you have a connecting out to the internet
40
41 # Usage: ./install_docker.sh <ip of default route to remove> <ip of default gw to add>
42
43 OLDGW=$1
44 NEWGW=$2
45 IMAGEPATH=/opt/opnfv
46 IMAGENAME=odl_docker_image.tar
47 SOURCES=/etc/apt/sources.list
48
49
50 if [ "$#" -ne 2]; then
51         echo "Two args not provided, will not touch networking"
52 else
53
54         # Fix routes
55         echo "Fixing routes"
56         #DEBUG
57         netstat -rn
58
59         echo "delete old def route"
60         route delete default gw $1
61         echo "adding new def route"
62         route add default gw $2
63
64         echo " you should see a good nslookup now"
65         nslookup www.google.ca
66 fi
67
68
69 if egrep "mirrors.txt" $SOURCES
70 then
71         echo "Sources was already updated, not touching"
72 else
73         echo "adding the closests mirrors and docker mirror to the mix"
74         echo "deb mirror://mirrors.ubuntu.com/mirrors.txt precise main restricted universe multiverse" >> /etc/apt/sources.list
75         echo "deb mirror://mirrors.ubuntu.com/mirrors.txt precise-updates main restricted universe multiverse" >> /etc/apt/sources.list
76         echo "deb mirror://mirrors.ubuntu.com/mirrors.txt precise-backports main restricted universe multiverse" >> /etc/apt/sources.list
77         echo "deb mirror://mirrors.ubuntu.com/mirrors.txt precise-security main restricted universe multiverse" >> /etc/apt/sources.list
78         apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
79         echo "deb https://get.docker.com/ubuntu docker main " > /etc/apt/sources.list.d/docker.list
80 fi
81
82 echo "Updating"
83 apt-get update
84 echo "Installing Docker"
85 apt-get install -y lxc-docker
86
87 echo "Loading ODL Docker Image"
88 docker load -i $IMAGEPATH/$IMAGENAME
89
90