#!/bin/bash

BRIDGE="{{ l2_bridge_name }}"

BRCTL=`which brctl`
IP=`which ip`

BRIDGE_ADDR="{{ l2_bridge_ipaddr }}/{{ l2_bridge_ipmask }}"
L2_EXT_IF="{{ l2_iface }}"
L2_STCP="{{ tap_iface_name }}"

# Bring links DOWN
${IP} link set dev ${L2_EXT_IF} down
${IP} link set dev ${L2_STCP} down
${IP} link set dev ${BRIDGE} down

# Remove bridge
${BRCTL} delbr ${BRIDGE}
