blob: fb8d2a0e4372ff3f79304f7f7f63b70f13d2ecbc [file] [log] [blame]
#! /bin/bash
controller=""
switches=`sudo ovs-vsctl list-br`
function host2ip (){
ip=`getent hosts $1 | awk '{print $1}' | tail -n 1`
echo $ip
}
url=""
for c in $controller; do
url="$url tcp:`host2ip $c`:6633"
done
echo $url
for s in $switches; do
echo "set switch $s controller $url"
sudo ovs-vsctl set-controller $s $url
done