#!/bin/bash -eux
# These were only needed for building VMware/Virtualbox extensions:
yum -y remove gcc cpp kernel-devel kernel-headers perl
yum -y clean all
rm -rf VBoxGuestAdditions_*.iso VBoxGuestAdditions_*.iso.?
rm -f /tmp/chef*rpm

# clean up redhat interface persistence
rm -f /etc/udev/rules.d/70-persistent-net.rules
if [ -r /etc/sysconfig/network-scripts/ifcfg-eth0 ]; then
  sed -i '/^HWADDR/d' /etc/sysconfig/network-scripts/ifcfg-eth0
  sed -i '/^UUID/d' /etc/sysconfig/network-scripts/ifcfg-eth0
fi
if [ -r /etc/sysconfig/network-scripts/ifcfg-ens33 ]; then
  sed -i '/^HWADDR/d' /etc/sysconfig/network-scripts/ifcfg-ens33
  sed -i '/^UUID/d' /etc/sysconfig/network-scripts/ifcfg-ens33
fi

#!/bin/bash -eux
# These were only needed for building VMware/Virtualbox extensions:
yum -y remove gcc cpp kernel-devel kernel-headers perl
yum -y clean all
rm -rf VBoxGuestAdditions_*.iso VBoxGuestAdditions_*.iso.?
rm -f /tmp/chef*rpm

# clean up redhat interface persistence
rm -f /etc/udev/rules.d/70-persistent-net.rules

for ndev in $(ls /etc/sysconfig/network-scripts/ifcfg-*); do
  if [ "$(basename ${ndev})" != "ifcfg-lo" ]; then
    sed -i '/^HWADDR/d' ${ndev}
    sed -i '/^UUID/d' ${ndev}
  fi
done

Remove HWADDR and UUID for every device except lo
Remove HWADDR and UUID for every device except lo
