mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-08-22 03:00:26 +00:00
29 lines
1.0 KiB
Plaintext
29 lines
1.0 KiB
Plaintext
#the nic name might change between the installation and 1st boot
|
|
#active all the nics with network link during system boot
|
|
for i in $(find /etc/sysconfig/network-scripts/ifcfg-*|egrep -v ifcfg-lo )
|
|
do
|
|
nicname=$(echo $i|awk -F 'ifcfg-' '{print $2}')
|
|
if ethtool $nicname|grep -E -i "Link detected.*yes" >/dev/null 2>&1
|
|
then sed -i 's/ONBOOT=no/ONBOOT=yes/' $i
|
|
fi
|
|
|
|
#remove the entry 'HWADDR' from ifcfg-ethx, this is used to skip the
|
|
#nic name change during the install and first_reboot
|
|
sed -i '/HWADDR/d' $i
|
|
done
|
|
|
|
if[ -f "/usr/lib/systemd/system/NetworkManager.service" ];then
|
|
systemctl stop NetworkManager
|
|
systemctl disable NetworkManager
|
|
fi
|
|
|
|
if[ -f "/usr/lib/systemd/system/NetworkManager-dispatcher.service" ];then
|
|
systemctl stop NetworkManager-dispatcher
|
|
systemctl disable NetworkManager-dispatcher
|
|
fi
|
|
|
|
if[ -f "/usr/lib/systemd/system/NetworkManager-wait-online.service" ];then
|
|
systemctl stop NetworkManager-wait-online
|
|
systemctl disable NetworkManager-wait-online
|
|
fi
|