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