I made a big mistake. Instead of typing :
rm -rf /etc/sysconfig/network-scripts/ifcfg-eth0
I typed:
rm -rf /etc/syconfig/network-scripts
Can anybody help me to repair this mistake?
Thanks in advance!
I made a big mistake. Instead of typing :
rm -rf /etc/sysconfig/network-scripts/ifcfg-eth0
I typed:
rm -rf /etc/syconfig/network-scripts
Can anybody help me to repair this mistake?
Thanks in advance!
$ rpm -qf /etc/sysconfig/network-scripts/
initscripts-9.03.27-1.el6.centos.i686
So, get the initscripts RPM and re-install it.
Update:
You can get it from http://mirrors.kernel.org/centos/6.2/os/i386/Packages/initscripts-9.03.27-1.el6.centos.i686.rpm
Of course, you can get your network interface up and running without actually using the "ifup" script, or whatever. They're basically wrappers for "ip" or "dhclient" in any case. For example, if your eth0 interface is supposed to get its configuration dynamically, you should be able to run "dhclient eth0" directly. If it's static, you should be able to run "ip link set dev eth0 up ; sleep 10 ; ip addr add 192.168.1.100 brd 192.168.1.255 dev eth0" or something like that. Consult "man ip" for the actual options. (I'm old fashioned, and am more used to running ifconfig eth0 192.168.1.100 up
or something similar).
Here's a list of what would have been in that directory and what some of those files would have looked like.
Type them in by hand until you can get the box back on the network.