aboutsummaryrefslogtreecommitdiffstats
path: root/charms/trusty/neutron-contrail/scripts/remove-juju-bridge.sh
blob: d9a9ec1ed2cb228378b514ce65eeea25b93d1299 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh -e
#
# Script used to remove Juju LXC bridge on MAAS systems

if [ ! -e /sys/class/net/juju-br0 ]; then
	exit 0
fi

interface=$(find /sys/class/net/juju-br0/brif | sed -n -e '2p' | xargs basename)

ifdown --force $interface juju-br0; sleep 5
cp interfaces /etc/network
cat <<-EOF >> /etc/network/interfaces
	auto $interface
	iface $interface inet dhcp
	EOF
ifup $interface