Skip to content

Instantly share code, notes, and snippets.

@flickerfly
Created September 12, 2013 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flickerfly/6538089 to your computer and use it in GitHub Desktop.
Save flickerfly/6538089 to your computer and use it in GitHub Desktop.
This is intended to clean up a CentOS or RedHat 6 box for conversion to a template in VMWare or other environments. It should be the last thing run before shutting down.
#!/bin/bash
# This is intended to clean up a CentOS or RedHat 6 box for
# conversion to a template in VMWare or other environments
# Free to use as a reference document, check before you use this
# as I can't take responsibility if it breaks something
# You may want to simply delete the config files,
# I prefer to just remove the MAC record
echo "Removing HWADDR lines from network configuration files (eth0-15)"
sed -i /HWADDR.*$/d /etc/sysconfig/network-scripts/ifcfg-eth[0-15]
echo "Removing udev rules with MAC associations"
rm /etc/udev/rules.d/70-persistent-net.rules
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment