#!/bin/bash
DEFAULTNAME=`ls /etc/sysconfig/network-scripts/ifcfg-en*`
EXPECTNAME=ifcfg-eth0
sed -i ‘s/DEVICE.*/DEVICE=eth0/g‘ $DEFAULTNAME
sed -i ‘s/ONBOOT.*/ONBOOT=yes/g‘ $DEFAULTNAME
mv $INITIALNAME /etc/sysconfig/network-scripts/$EXPECTNAME
sed -i ‘s/GRUB_CMDLINE_LINUX="/GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0 /g‘ /etc/default/grub
grub2-mkconfig -o /boot/grub2/grub.cfg
echo "please reboot system"
时间: 2024-10-26 11:42:10