Last active
December 21, 2015 15:39
-
-
Save aspring/6328332 to your computer and use it in GitHub Desktop.
An init.d script that can be used to overcome the MAC address changes when copying a virtual machine. This has been tested on Centos. To utilize this script, add it to init.d, then link it to rc3.d: ln -s /etc/init.d/removepersistentnetrules /etc/rc.d/rc3.d/S99removepersistentnetrules
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
FIRSTBOOT="/etc/.firstboot" | |
if [ ! -f $FIRSTBOOT ]; | |
then | |
# Remove the first boot files | |
rm -f /etc/udev/rules.d/70-persistent-net.rules | |
# Restart the network service | |
service network restart | |
# Touch file so this does not run again | |
touch $FIRSTBOOT | |
# Restart the system so that it picked up the change | |
shutdown -r now | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment