mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-05-21 11:12:04 +00:00
Merge pull request #6139 from bybai/eth_fix
fix configeth using nmcli connection name with space
This commit is contained in:
commit
2386723ddd
@ -133,7 +133,7 @@ function configipv4(){
|
||||
fi
|
||||
str_conf_file="/etc/sysconfig/network-scripts/ifcfg-${str_if_name}"
|
||||
if [ $networkmanager_active -eq 1 ]; then
|
||||
con_name=$(nmcli dev show ${str_if_name}|grep CONNECTION|awk -F: '{print $2}'|sed 's/^[ \t]*$//g')
|
||||
con_name=$(nmcli -g CONNECTIONS dev show ${str_if_name}|awk -F"|" '{print $NF}'|sed 's/^[ \t]*//g')
|
||||
if [ "$con_name" == "--" ] ; then
|
||||
nmcli con add type ethernet con-name ${str_if_name} ifname ${str_if_name} ipv4.method manual ipv4.addresses ${str_v4ip}/${str_prefix}
|
||||
else
|
||||
@ -624,7 +624,7 @@ elif [ "$1" = "-s" ];then
|
||||
str_inst_prefix=$(v4mask2prefix ${str_inst_mask})
|
||||
str_conf_file="/etc/sysconfig/network-scripts/ifcfg-${str_inst_nic}"
|
||||
if [ $networkmanager_active -eq 1 ]; then
|
||||
con_name=$(nmcli dev show ${str_if_name}|grep CONNECTION|awk -F: '{print $2}'|sed 's/^[ \t]*$//g')
|
||||
con_name=$(nmcli -g CONNECTIONS dev show ${str_if_name}|awk -F"|" '{print $NF}'|sed 's/^[ \t]*//g')
|
||||
if [ "$con_name" == "--" ] ; then
|
||||
nmcli con add type ethernet con-name ${str_inst_nic} ifname ${str_inst_nic} ipv4.method manual ipv4.addresses ${str_inst_ip}/${str_inst_prefix}
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user