pxebr bridge is needed by Fuel, but causes issues with Foreman. It is
now removed in clean.sh. setup.sh is also updated to be executable and
fixes a bug where grep was being used on output that is in stderr.
JIRA: OCTO-109
Change-Id: I037e168e40f3352a61a604ed6cea21d10250b434
Signed-off-by: Tim Rozet <trozet@redhat.com>
blue=`tput setaf 4`
red=`tput setaf 1`
green=`tput setaf 2`
blue=`tput setaf 4`
red=`tput setaf 1`
green=`tput setaf 2`
vm_dir=/var/opt/opnfv
##END VARS
vm_dir=/var/opt/opnfv
##END VARS
echo "${blue}Removed Kernel Module: $kernel_mod ${reset}"
fi
done
echo "${blue}Removed Kernel Module: $kernel_mod ${reset}"
fi
done
+
+###remove pxebr
+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}
+ fi
+ brctl delbr ${pxe_bridge}
+ if ifconfig | grep ${pxe_bridge} || brctl show | grep ${pxe_bridge}; then
+ echo "${red}Error trying to remove ${pxe_bridge}${reset}"
+ exit 1
+ else
+ echo "${blue}PXE bridge ${pxe_bridge} removed${reset}"
+ fi
+else
+ echo "${blue}PXE bridge ${pxe_bridge} does not exist${reset}"
+fi
#Check whether PXE bridge exists
echo "${blue}Checking whether PXE bridge ${pxe_bridge} exists${reset}"
#Check whether PXE bridge exists
echo "${blue}Checking whether PXE bridge ${pxe_bridge} exists${reset}"
- if brctl show ${pxe_bridge} | grep 'No such device'; then
+ if brctl show ${pxe_bridge} 2>&1 | grep 'No such device'; then
echo "${blue}Creating PXE bridge ${pxe_bridge}${reset}"
brctl addbr ${pxe_bridge}
else
echo "${blue}Creating PXE bridge ${pxe_bridge}${reset}"
brctl addbr ${pxe_bridge}
else
#Add VLAN 0 (PXE) interface to PXE bridge
echo "${blue}Checking whether VLAN 0 (PXE) interface ${pxe_interface} is added to PXE bridge ${pxe_bridge} exists${reset}"
#Add VLAN 0 (PXE) interface to PXE bridge
echo "${blue}Checking whether VLAN 0 (PXE) interface ${pxe_interface} is added to PXE bridge ${pxe_bridge} exists${reset}"
- if ! brctl show ${pxe_bridge} | grep ${pxe_interface}; then
+ if ! brctl show ${pxe_bridge} 2>&1 | grep ${pxe_interface}; then
echo "${blue}Adding VLAN 0 (PXE) interface ${pxe_interface} to PXE bridge ${pxe_bridge}${reset}"
brctl addif ${pxe_bridge} ${pxe_interface}
echo "${blue}Adding VLAN 0 (PXE) interface ${pxe_interface} to PXE bridge ${pxe_bridge}${reset}"
brctl addif ${pxe_bridge} ${pxe_interface}
- if ! brctl show ${pxe_bridge} | grep ${pxe_interface}; then
+ if ! brctl show ${pxe_bridge} 2>&1 | grep ${pxe_interface}; then
echo "${red}Could not add VLAN 0 (PXE) interface ${pxe_interface} to PXE bridge ${pxe_bridge}${reset}"
exit 1
fi
echo "${red}Could not add VLAN 0 (PXE) interface ${pxe_interface} to PXE bridge ${pxe_bridge}${reset}"
exit 1
fi