Masayoshi Kobayashi | 57572b1 | 2013-03-13 22:27:50 +0000 | [diff] [blame] | 1 | #! /bin/bash |
| 2 | controller="" |
Masayoshi Kobayashi | b738b21 | 2013-04-03 02:26:51 +0000 | [diff] [blame] | 3 | #switches=`ifconfig -a | grep sw |grep -v eth | awk '{print $1}'` |
| 4 | switches=`sudo ovs-vsctl list-br` |
Masayoshi Kobayashi | 57572b1 | 2013-03-13 22:27:50 +0000 | [diff] [blame] | 5 | |
| 6 | function host2ip (){ |
| 7 | ip=`grep $1 /etc/hosts |grep -v "ip6"| awk '{print $1}'` |
| 8 | echo $ip |
| 9 | } |
| 10 | |
| 11 | url="" |
| 12 | for c in $controller; do |
| 13 | url="$url tcp:`host2ip $c`:6633" |
| 14 | done |
| 15 | echo $url |
| 16 | for s in $switches; do |
Masayoshi Kobayashi | 8afa882 | 2013-04-02 22:20:33 +0000 | [diff] [blame] | 17 | echo -n "$s : " |
Masayoshi Kobayashi | 57572b1 | 2013-03-13 22:27:50 +0000 | [diff] [blame] | 18 | sudo ovs-ofctl show $s |grep dpid |
| 19 | done |