jump to navigation

Script To Fix eth0 After Moving VM January 11, 2009

Posted by ModelR in UBUNTU LAMP Project.
trackback
THIS IS A SUBSECTION OF THE VERY VITAL UBUNTU LAMP SERVER PROJECT

You can find the full outline of this project here:
LINK: Very Vital Ubuntu LAMP Server Project Outline

Please support this project.
Make A Donation

Download a copy of the script to look over: fixeth0.sh in text format

Create a new file called “/usr/local/bin/fixeth0.sh:
$ sudo nano /usr/local/bin/fixeth0.sh

#!/bin/bash
# Script to fix eth0 as a result of moving the VM
echo ""
echo "************************************"
echo "*VM HAS MOVED NOW WE'RE FIXING ETH0*"
echo "************************************"
echo ""
if [ $(id -u) -eq 0 ]; then
sudo rm /etc/udev/rules.d/70-persistent-net.rules
sudo shutdown -r now
else
echo "Only root can delete a user from the system"
exit 2
fi

Make the script executable
$ sudo chmod 755 /usr/local/bin/fixeth0.sh

Advertisements

Comments»

No comments yet — be the first.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: