tools/deployment/libvirt/destroy_network.sh
Dean Troyer bd4b59dde2 Clean up the libvirt install bits
* Split the network setup/teardown bits into their own scripts
  so you can shoot yourself in the foot with intention
  rather then unexpectedly.
* Cowardly refuse to configure a network if the first interface name exists
* Change the default bridge name to stxbr
* Make the network variables all configurable via the environment
* Don't make assumptions about where ISOIMAGE is located
* Include a basic doc that outlines the differences from existing
  installation steps. (Needs more!)

Change-Id: Ic46c03a09da97765b9f6bfe07e089efa38738993
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
2018-08-30 10:40:57 -05:00

16 lines
504 B
Bash
Executable File

#!/usr/bin/env bash
BRIDGE_INTERFACE=${BRIDGE_INTERFACE:-stxbr}
INTERNAL_NETWORK=${INTERNAL_NETWORK:-10.10.10.0/24}
INTERNAL_IP=${INTERNAL_IP:-10.10.10.1/24}
EXTERNAL_NETWORK=${EXTERNAL_NETWORK:-192.168.204.0/24}
EXTERNAL_IP=${EXTERNAL_IP:-192.168.204.1/24}
for i in {1..4}; do
BRIDGE_INTERFACE_NAME=${BRIDGE_INTERFACE}$i
if [ -d "/sys/class/net/${BRIDGE_INTERFACE_NAME}" ]; then
sudo ifconfig ${BRIDGE_INTERFACE_NAME} down
sudo brctl delbr ${BRIDGE_INTERFACE_NAME}
fi
done