X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=planetlab%2Fscripts%2Fsliver-ovs.in;h=edda1961b9a89b6dd19dd25ab821d5db107b1f97;hb=2b13d312fc4d6e5eb1d0e3004fa523bb0c0ba544;hp=d72be7286a4ce0b7039cbbd54955d2f438d91630;hpb=620606f63cc56c7541005dc6787106789e2c364e;p=sliver-openvswitch.git diff --git a/planetlab/scripts/sliver-ovs.in b/planetlab/scripts/sliver-ovs.in index d72be7286..edda1961b 100755 --- a/planetlab/scripts/sliver-ovs.in +++ b/planetlab/scripts/sliver-ovs.in @@ -67,10 +67,10 @@ function wait_server () { } function wait_device () { - tapname=$1; shift - timeout=$1; shift + local tapname=$1; shift + local timeout=$1; shift - expire=$(($(date +%s) + $timeout)) + local expire=$(($(date +%s) + $timeout)) while ! ip link show up | egrep -q "^[0-9]+: +$tapname:"; do echo "Waiting for $tapname to come UP...$(($expire - $(date +%s)))s left" >&2 @@ -100,10 +100,10 @@ function start_db () { if [ ! -f "$RUN_DIR/ovsdb-server.pid" ]; then ovsdb-server $DB_CONF_FILE \ --remote=punix:$DB_SOCKET \ - --remote=db:Open_vSwitch,manager_options \ - --private-key=db:SSL,private_key \ - --certificate=db:SSL,certificate \ - --bootstrap-ca-cert=db:SSL,ca_cert \ + --remote=db:Open_vSwitch,Open_vSwitch,manager_options \ + --private-key=db:Open_vSwitch,SSL,private_key \ + --certificate=db:Open_vSwitch,SSL,certificate \ + --bootstrap-ca-cert=db:Open_vSwitch,SSL,ca_cert \ --pidfile \ --log-file=$DB_LOG \ --detach >& /dev/null @@ -177,6 +177,12 @@ function create_bridge () { -- set bridge "$bridge" datapath_type=planetlab \ -- set interface "$bridge" options:local_ip="$IP" option:local_netmask="$PREFIX" \ -- "$@" + + # check that the bridge has actually been created + if [ -z "$W" ]; then + local tap=$(ovs-appctl netdev-pltap/get-tapname "$bridge") + wait_device $tap 10 + fi } function create_port () {