2014-08-09 09:20:50 +00:00
|
|
|
#/bin/sh
|
|
|
|
#modify the grub.cfg to prevent nic consistent network renameing
|
|
|
|
grep -E -q "net.ifnames=0" /etc/sysconfig/grub || sed -i '/^GRUB_CMDLINE_LINUX=.*/{s/"$/ net.ifnames=0"/}' /etc/sysconfig/grub
|
|
|
|
grep -E -q "net.ifnames=0" /etc/default/grub || sed -i '/^GRUB_CMDLINE_LINUX=.*/{s/"$/ net.ifnames=0"/}' /etc/default/grub
|
2014-11-20 09:57:27 +00:00
|
|
|
|
|
|
|
if [ -f "/boot/efi/EFI/redhat/grub.cfg" ];then
|
|
|
|
GRUB_CFG_FILE="/boot/efi/EFI/redhat/grub.cfg"
|
|
|
|
#elif [ -f "/boot/efi/efi/SuSE/elilo.efi" ];then
|
|
|
|
elif [ -f "/boot/grub2/grub.cfg" ];then
|
|
|
|
GRUB_CFG_FILE="/boot/grub2/grub.cfg"
|
|
|
|
elif [ -f "/boot/grub/grub.cfg" ];then
|
|
|
|
GRUB_CFG_FILE="/boot/grub/grub.cfg"
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
grub2-mkconfig -o "$GRUB_CFG_FILE"
|