selftest: Reformat shell scripts
[Samba.git] / selftest / ns / add_bridge_iface.sh
blob4090319cf70f28fe77eb09cc0518eaae6ed5b8f5
1 #!/bin/sh
3 # Configures the interfaces needed for communication between namespaces.
4 # This handles the bridge-end of the veth pair.
5 interface=$1
7 # the main bridge interface is called 'selftest0' (although in future we may
8 # want to segregate the different domains by using different bridges)
9 bridge=$2
11 # we need to wait for the child namespace to start up and add the new
12 # interface back to our new namespace
13 while ! ip link show $interface >/dev/null 2>&1; do
14 sleep 0.1
15 echo "Waiting for $interface to be created..."
16 done
18 # bring the bridge-end of the link up and add it to the bridge
19 ip link set dev $interface up
20 ip link set $interface master $bridge