blob: 023a9db401d8854cc9977720d2c35e8e583b7bcb [file] [log] [blame]
#! /bin/bash
controller=`hostname`
switches=`ifconfig -a | grep sw |grep -v eth | awk '{print $1}'`
function host2ip (){
ip=`grep $1 /etc/hosts |grep -v "ip6"| awk '{print $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