summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Rozet <trozet@redhat.com>2015-09-15 20:32:04 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2015-09-15 20:32:04 +0000
commit54f12d2bdd72ae12061ebf62c5b70f357850c411 (patch)
tree0d468c0afe0f498996311817c2a9999020f7ea11
parent99a3f93de07d884101c8e6b37343280231e6c94a (diff)
parent7712e269aa1555378b15bc1124029561be306242 (diff)
Merge "FIX for bringing down pxebr in clean.sh" into stable/arno
-rwxr-xr-xcommon/ci/clean.sh11
1 files changed, 9 insertions, 2 deletions
diff --git a/common/ci/clean.sh b/common/ci/clean.sh
index da75205..caaf88f 100755
--- a/common/ci/clean.sh
+++ b/common/ci/clean.sh
@@ -239,8 +239,15 @@ done
echo "${blue}Checking whether PXE bridge ${pxe_bridge} exists${reset}"
if ! brctl show ${pxe_bridge} 2>&1 | grep -i 'No such device'; then
echo "${blue}PXE bridge detected. Removing...${reset}"
- if ifconfig | grep ${pxe_bridge}; then
- ifdown ${pxe_bridge}
+ link_state=$(ip link show ${pxe_bridge} | grep -oP 'state \K[^ ]+')
+ if [[ ${link_state} != 'DOWN' ]]; then
+ ip link set dev ${pxe_bridge} down
+ sleep 5
+ link_state=$(ip link show ${pxe_bridge} | grep -oP 'state \K[^ ]+')
+ if [[ ${link_state} != 'DOWN' ]]; then
+ echo "${red}Could not bring DOWN bridge ${pxe_bridge} link state is ${link_state}${reset}"
+ exit 1
+ fi
fi
brctl delbr ${pxe_bridge}
if ifconfig | grep ${pxe_bridge} || brctl show | grep ${pxe_bridge}; then