mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-05-30 01:26:38 +00:00
33 lines
1.2 KiB
Bash
33 lines
1.2 KiB
Bash
#!/bin/bash
|
|
# The nic name might change between the installation and 1st boot
|
|
# Active all the nics with network link during system boot
|
|
|
|
[ "$XCATDEBUGMODE" ] || export XCATDEBUGMODE="#TABLEBLANKOKAY:site:key=xcatdebugmode:value#"
|
|
[ "$MASTER_IP" ] || export MASTER_IP="#ENV:MASTER_IP#"
|
|
#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/scriptlib#
|
|
|
|
for i in $(ls /etc/sysconfig/network-scripts/ifcfg-* | grep -v ifcfg-lo)
|
|
do
|
|
nicname="${i##*-}"
|
|
if ethtool $nicname | grep -E -i -q "Link detected.*yes" >/dev/null 2>&1
|
|
then
|
|
case "$XCATDEBUGMODE" in
|
|
"1"|"2")
|
|
msgutil_r "$MASTER_IP" "info" "set NIC $nicname to be activated on system boot" "/var/log/xcat/xcat.log"
|
|
;;
|
|
esac
|
|
sed -i 's/ONBOOT=no/ONBOOT=yes/' "$i"
|
|
fi
|
|
done
|
|
|
|
# List of internal repos to be disabled
|
|
|
|
internet_repo_file_list="oracle-linux-ol8.repo uek-ol8.repo Rocky-AppStream.repo Rocky-BaseOS.repo Rocky-Extras.repo CentOS-Base.repo almalinux-ha.repo almalinux-nfv.repo almalinux-powertools.repo almalinux.repo almalinux-resilientstorage.repo almalinux-rt.repo"
|
|
|
|
for repo_file in $internet_repo_file_list
|
|
do
|
|
if [ -f /etc/yum.repos.d/$repo_file ]; then
|
|
sed -i -e 's/enabled=1/enabled=0/' /etc/yum.repos.d/$repo_file
|
|
fi
|
|
done
|