mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-05-29 09:13:08 +00:00
delete space before nmcli connection name
This commit is contained in:
parent
1ef014a25b
commit
5452d36b50
@ -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