Skip to content

Commit

Permalink
Use 'nmcli con modify' for nicextraparams on RHEL9
Browse files Browse the repository at this point in the history
  • Loading branch information
alexrichert committed May 28, 2024
1 parent 167d029 commit 54e749d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions xCAT/postscripts/nicutils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1807,9 +1807,19 @@ function add_extra_params_nmcli {

nicdev=$1
con_name=$2

# For RHEL 9, use nmcli directly, otherwise use ifcfg scheme.
# Parameters should still be specified with "=", e.g., "ethernet.mtu=1600"
if [[ "$OSVER" =~ rhels9 ]]; then
nmcli con modify "$con_name" "${nicdev%=*}" "${nicdev#*=}"
return $?
fi

rc=0

str_conf_file="/etc/sysconfig/network-scripts/ifcfg-${con_name}"
str_conf_file_1="/etc/sysconfig/network-scripts/ifcfg-${con_name}-1"

if [ -f $str_conf_file_1 ]; then
grep -x "NAME=$con_name" $str_conf_file_1 >/dev/null 2>/dev/null
if [ $? -eq 0 ]; then
Expand Down

0 comments on commit 54e749d

Please sign in to comment.