#!/bin/bash
# bowe@redhat.com
set -x

# strip a machine of all identifiying materials, so that it
# may become a master image.

F=/etc/sysconfig/network-scripts/ifcfg-eth0
[ -e $F ] && sed -i '/HWADDR/d' $F

F=/etc/sysconfig/network-scripts/ifcfg-br0
[ -e $F ] && sed -i '/HWADDR/d' $F

sed -i '/HOSTNAME/d' /etc/sysconfig/network

cat > /etc/hosts << EOT
127.0.0.1         localhost localhost.localdomain
::1               localhost6 localhost6.localdomain6
EOT

rm -f /etc/udev/rules.d/70-persistent-net.rules

shutdown -P now
history -c
