blob: 023a9db401d8854cc9977720d2c35e8e583b7bcb [file] [log] [blame]
Masayoshi Kobayashi79ac5052013-02-27 19:16:14 +00001#! /bin/bash
Masayoshi Kobayashi6a12e6b2013-03-12 18:30:35 +00002controller=`hostname`
Masayoshi Kobayashi79ac5052013-02-27 19:16:14 +00003switches=`ifconfig -a | grep sw |grep -v eth | awk '{print $1}'`
4
5function host2ip (){
6 ip=`grep $1 /etc/hosts |grep -v "ip6"| awk '{print $1}'`
7 echo $ip
8}
9
10url=""
11for c in $controller; do
12 url="$url tcp:`host2ip $c`:6633"
13done
14echo $url
15for s in $switches; do
16 echo "set switch $s controller $url"
17 sudo ovs-vsctl set-controller $s $url
18done